wonderfl本
on 2009/12/23 11:40, under actionscript3, flash | Comment
ワークスコーポレーション
売り上げランキング: 3750
wonderfl本、出ましたね。自分は、「はじめに」と「1-1」を担当させていただきました。
これからFlashやActionscript3をはじめたい、という初心者にとっては本当に役に立つサービス&本だと思いますので、よろしければ読んでみてください。
DBICでcreate_relatedをoverrideする
on 2009/11/26 14:11, under perl | Comment
DBICを使っています。
User has_many Histories
っていう関係のテーブルUserとHistoryがあった時に、
Userの行それぞれに対して、最新のHistoryをUserの行の中にキャッシュしておくと便利なときがあります。
そんな時に、$user->add_to_histories ってやった時に $userもupdateしたい、という話です。
-
CREATE TABLE user (id unsigned not null auto_increment, **中略**, history unsigned not null);
-
CREATE TABLE history (id unsigned not null auto_increment, user unsigned not null, **中略**, created_date datetime not null);
UserのRowクラスは
-
中略
-
__PACKAGE__->has_many( histories => 'Schema::Row::History', 'user' );
HistoryのRowクラスは
-
中略
-
__PACKAGE__->belongs_to( user => 'Schema::Row::User' );
UserのRowクラスに追加されるadd_to_$relを使って
-
$user->add_to_histories({ action => 'marriage' });
とかってやるわけです。
HistoryのRowを追加する時にcreated_dateを意識せずに設定したいときとかに、
HistoryのRowクラスに↓って書いておきます
これはよくやるんですが、同じタイミングでUserの方もupdateしたいって時に、
UserのRowクラスに、
って書いておくと、便利だわー
typester++
[perl]32bit/64bitでメモリ使用量違うけど
on 2009/11/12 13:39, under perl | Comment
同じperlのコードを、2台の違うサーバで動かした時に、やたらメモリ量が違うなぁと。
サーバ1: 50MBくらい
サーバ2: 200MBくらい
なんでだろと調べる
サーバ1で
-
perl -V
-
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
-
Platform:
-
osname=linux, osvers=2.6.26-1-686, archname=i486-linux-gnu-thread-multi
-
...
-
use64bitint=undef, use64bitall=undef, uselongdouble=undef
-
...
-
Compiler:
-
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
-
optimize='-O2 -g',
-
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include'
-
ccversion='', gccversion='4.3.2', gccosandvers=''
-
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
-
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
-
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
-
alignbytes=4, prototype=define
サーバ2で
-
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
-
Platform:
-
osname=linux, osvers=2.6.26-1-vserver-amd64, archname=x86_64-linux-gnu-thread-multi
-
...
-
use64bitint=define, use64bitall=define, uselongdouble=undef
-
...
-
Compiler:
-
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
-
optimize='-O2 -g',
-
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include'
-
ccversion='', gccversion='4.3.2', gccosandvers=''
-
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
-
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
-
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
-
alignbytes=8, prototype=define
longsize, ptrsizeとかが違う
32bit → 64bit!
モジュールをuseした際のメモリ使用量(増加量)を調べてみるで紹介されていたGTopのスクリプトを使ってみる
サーバ1で
-
% script/gtop.pl 'use Catalyst'
-
10.5M : use Catalyst
-
% script/gtop.pl 'use DBIx::Class'
-
396k : use DBIx::Class
-
% script/gtop.pl 'use Moose'
-
Moose does not export its sugar to the 'main' package.
-
4.6M : use Moose
fmfm
サーバ2で
-
% script/gtop.pl "use Catalyst"
-
42.6M : use Catalyst
-
% script/gtop.pl "use DBIx::Class"
-
920k : use DBIx::Class
-
% script/gtop.pl "use Moose ()"
-
17.9M : use Moose ()
!!!
搭載してるメモリ量は4GBとかで変わらないから、
リスクが無ければ32bitでコンパイルしたperlを使ったりするもんなのだろうか?
IO::AIOお試し
on 2009/10/22 23:09, under perl | Comment
AnyEvent/Coro期がわたしにもやってきましたよ。
ファイル書き込みを非同期でやりたいのでIO::AIO試してみました。
Coro::AIO使えばcallback形式ではなく綺麗に書けるようだけれどとりあえずIO::AIOの書き方で。
結果は、↓とかってなるから非同期的な感じだなぁっていうのはわかるんですが、
AnyEventの $cv->send , $cv->recv をとっぱらっても同じように動く。
なぜ?
Event loop integrationっていうのはそれが無い状態に対して、何してくれるの?
-
perl try/anyevent_aio.pl
-
[pre] at try/anyevent_aio.pl line 5.
-
[aft] at try/anyevent_aio.pl line 13.
-
[opened]0
-
[opened]1
-
[opened]2
-
[opened]3
-
[opened]4
-
[opened]5
-
[opened]6
-
[opened]7
-
[opened]8
-
[opened]9
-
[wrote]0
-
[wrote]1
-
[wrote]2
-
[wrote]4
-
[wrote]6
-
[wrote]3
-
[wrote]7
-
[wrote]5
-
[wrote]8
-
[closed]9:0
-
[closed]8:1
-
[closed]7:2
-
[closed]6:4
-
[closed]5:6
-
[closed]4:3
-
[closed]3:7
-
[closed]2:5
-
[wrote]9
-
[closed]1:8
-
[closed]0:9
going to Adobe MAX NA 2009
on 2009/09/24 10:45, under fitc, wonderfl, adobe, flash | Comment
I'm going to Adobe MAX NA 2009!
to give a talk about
wonderfl build flash online, the browser-based Actionscript IDE and community
http://wonderfl.net/
at the FITC Unconference room
http://www.fitc.ca/events/schedule/?event=100
Wednesday October 7, 10:30 - 11:00
might be hard to wake up to attend a 10:30 session if you're having beer whole night long,
but FITC Unconference room has a FREE BEER for you,
so why not have one in the morning?
おすすめのパスタレシピ本
on 2009/06/13 14:57, under gourmet | Comment
家で料理をすることも週末は多いので、レシピの本を何冊か持っている。
ケンタロウさんの本や、にんにくのレシピ本や他のも。
レシピ本には、たいていレシピとできあがりの画像だけ載っている。
著者によって、使う素材が違ったり、にんにくばかり使うレシピだったり。
先日ラ・ベットラ・ダ・オチアイ、という、落合さんがやってるイタリアンレストランに行って来た。
普段は長い行列のところ、何曜日だったか、その曜日に行けば並ばずに済む、という日。
スパゲッティも前菜もおいしくて、店主である落合さんの書いているレシピ本に気がついて、
ご飯を食べ終わった後しばらく読みふけり、帰ってからamazonでぽちっとした。
幻冬舎
売り上げランキング: 215921

思ったよりシンプルでも本格的な味
やっぱりラ・ベットラ
作りやすいレシピです
ちょっと残念
スパゲティを極める
おすすめするのは、
何のためにワインを入れるのか、そしてせっかくワインを入れたのになぜ煮詰めなきゃいけないのか・・・。そういう”どうして?”をひとつひとつ解決できれば、もっとおいしい料理を作れるようになるはず。そういう理屈を知っていけば、料理はすごく楽しくなると思う。
という考えが見えるから。
そういったロジックがレシピの前後にちょろっと書いてある。
土日しか作らないから、先週つくって失敗したリベンジしようと思っても、
試行錯誤しておいしさのロジックを自分の身体で学んでいくほど味と手順を覚えていられないし、
至高の味を目指しているのにレシピの可能性は無限だ。
先人の知恵にすがるべきところ。
スパゲッティ好きな人はみんな買うといいと思います。
県毎のiareaの数
on 2009/05/27 15:22, under mobile | Comment
memo
宮城: 4
茨城: 5
北海道: 32
福島: 4
岩手: 3
滋賀: 4
三重: 8
高知: 4
東京: 99
宮崎: 3
長野: 12
広島: 9
沖縄: 3
静岡: 15
山梨: 3
青森: 3
山形: 4
山口: 4
京都: 20
埼玉: 12
熊本: 5
福岡: 15
和歌山: 8
大阪: 27
徳島: 4
石川: 11
千葉: 10
愛媛: 4
奈良: 4
秋田: 3
兵庫: 22
神奈川: 31
富山: 5
新潟: 6
福井: 5
鹿児島: 7
岐阜: 6
大分: 5
佐賀: 2
岡山: 5
群馬: 6
島根: 6
鳥取: 3
長崎: 5
香川: 4
栃木: 6
愛知: 39
Hoppyいいよ
on 2009/05/15 21:41, under flash, perl | 1 Comment
Hoppyいい
シリコンバレー行った時に参加した Flash Game Summit とかでも、FITC Toronto 2009でも、マルチプレーヤーFlash熱そうだったので自分の周りではきてる。
汎用的なXMLSocketサーバを書いた
POEとか使ったシングルプロセスシングルスレッドのデーモンでデータベース扱う時はどうするのがいいんだろう?
裏にDB扱うためだけにhttpサーバ置いてデーモンからはそれに非同期でhttpリクエストするという方法がある。
ということでまずはauthを非同期にしてみました。
http://github.com/mash/Hoppy/tree/master
$c->handlerってtcp周りのイベントのハンドラってことでいいのかな。
-
$c->regist_service(
-
auth => 'MyApp::Auth',
-
);
ってやると $c->handler->{auth} に入るのは気のせいかと思いたかったので
s/handler/service/ してみました。めっちゃコアっぽいけどまぁいいか。
ごめんねColinちゃん。
FITC Toronto 2009 presentation
on 2009/05/03 18:28, under fitc, flash | Comment
my presentation is here.
http://maaash.jp/fitctoronto2009
The presentation uses my 1st Flash/as3 project, pixie. Heavy, but OK.
FITC Toronto 2009 day 1,2
on 2009/04/28 13:48, under fitc, flash | Comment
Some thoughts, memo of inspirations I got in these 2 days.
And also, thanks for the guys who came to our presentation.
### BEAUTIFUL ALGORITHMS: DESIGN FROM NATURE AND MATHEMATICS
ALEC COVE
WWW.COVE.ORG
人には効率よいことを美しいと感じる性質がある
keywords I got: "l-systems", "reaction diffusion", "harmonograph", "buddhabrot"
### THE TINKERER'S BOX
MARIO KLINGEMANN
WWW.QUASIMONDO.COM
keywords "Stippling"
Mario looked very FUN!
When he was saying something like: "I can continue this for like,, 2minutes more", while clicking on triangles and dividing them,
I was pretty sure FUN is the point.
If people just continue what they feel fun, that's gonna take you to the top of the world.
Even if it starts with just dividing triangles :-)
### SPACE
JOSHUA DAVIS
WWW.JOSHUADAVIS.COM
That was not a presentation, it was entertainment.
I'm a big fan of him now.
### FLASHDUINO!
BRET FORSYTH
WWW.VFS.COM / BLOG.THESTEM.CA
I'm thinking about collaboration with these Flash interfacing hardware: Arduino, Gainer (in Japan), so this presentation gave me very much nice inspiration.
This has to be more easy.
And making things easy, is my job.
wonderfl makes creating Flash and collaborating between Flash developers easy, and I'm searching for something next.
Launching a local application to start accessing the hardware from Flash is too much complicated, we need direct access from Flash Player to USB, in case of security, just show a dialog box like Flash Player shows when accessing camera or microphone.
Maybe I'll just start with something simple and easy to implement, but I think there's pioneer-waiting-future in this area.
vimeo.com/groups/arduinoproject
liquidware
### IMMERSIVE ENVIRONMENTS AND INTERACTIVE CINEMA
DANIEL RILEY, RYAN ANDAL
WWW.LIVECAPTUREINC.COM
Knowledge: Make multiple flv, test user connection speed while loading, stream the appropriate vidoe for their speed.
### PROFESSIONALLY PUSHING PIXELS
RALPH HAUWERT
WWW.UNITZEROONE.COM
I remember somebody had a session in the last MAX Japan about "understand what Flash is good at, and not good at",
and this time Ralph talked about these targeting Flash's new features: Alchemy and PixelBender.
Alchemy uses C,C++ so Math using bytearray is superfast, but marshalling between Actionscript world and C world is dead slow.
PixelBender uses multi cpu cores, so....... I couldn't understand....
But. I'm looking forward to seeing PapervisionX.
### FLASH PLAYER INTERNALS V2
JIM CORBETT
WWW.ADOBE.COM
New information was about the search player which Jim in Adobe developed and provided to Google.
Google has a AI, which acts like an user, pressing buttons in your swf and sees what happens in the displaylist, check for TextFields that appear in the list, and make those text searchable.
Everything only in the displaylist visible is collected, and non visible displayobjects, exists but not added to the displaylist is not.
Cool.
I can thing of like a hand full of ways to trick the crawler, for example showing a black rectanble over black colored text can't be recognized by human, but mustbe collected by Google.
So I don't thing this approach is good, Google should implement a OCR kind of client, maybe it's just a matter of time.
### HARVEST
JAMES PATERSON
WWW.PRESSTUBE.COM
coooooooool animation.
Quote: "delegate the problem to subconscious by drawing"
That's nice.
I delegate a problem to my subconscious by sleeping.
### CHECK. CHECK. IS THIS THING ON?
CHUCK FREEDMAN
WWW.CHUCKSTAR.COM/BLOG / DEVELOPER.RIBBIT.COM
Hey, I'm in!
http://bugs.adobe.com/jira/browse/FP-1766
Vote on it!!!
Yes, I also thinks it's gonna be another breakthrough if I could just connect my electric guitar into my laptop and start making noise.
When is ribbit bringing one of their internet-phonenetwork bridge to Japan?
Because it must cost international phonecall fees to make a call from Flash to a number inside Japan.
### DAME JUDY DENCH COULD KICK MY MOTHERS ASS
MK12
WWW.MK12.COM
I don't think the user interface in 007 is one of our possible future, but having a green room in our company might be fun!
yokohama.pm 4回目行ってきた&DI
on 2009/04/21 1:11, under yokohamapm, perl | Comment
いいまとめはこちら
http://d.hatena.ne.jp/hiratara/20090417/1239946298
DIがよくわからなかったなぁ
Bread::Boardの感じだと結局コンストラクタに引数与えるのを書き方かえるだけに見えるけど
外部のxmlファイルに記述したくない、って牧さんは言ってたけど、
フォーマットがxmlかどうかは別として、javaをちょいちょい使ってる時の認識では、
別ファイルであることがDIの本質なんじゃないのかなぁと思っていた。
javaはコンパイルの必要な言語で、
xmlを変えてもリコンパイルが必要無い、
ってメリットがjavaではある
使うときにオブジェクトを渡して、使う側ではインターフェースしか使ってない、
こういうのもDIっていうかな
これをいい感じに書けるのがBread::Boardなのかな
-
package A;
-
use Moose;
-
-
has cache => ( isa => 'Cache::Cache', is => 'rw', required => 1, default => sub { new Cache::FileCache } );
-
-
sub fetch_something {
-
my ($self, $key) = @_;
-
my $ret = $self->cache->get($key);
-
$ret = fetch($key);
-
$self->cache->set( $key, $ret );
-
}
-
$ret;
-
}
-
1;
飲み会行かれなくて残念
preventing cache stampedes
on 2009/04/09 18:39, under memcached, cache, perl | Comment
webサイトとかで、重いSQLを使ったページを快適に表示するために、重いSQLの結果をキャッシュするためにmemcachedとかをよく使います。
キャッシュの有効期限が切れた後に、大量のリクエストに対応して大量の重いSQLが走ると困るので、どうしよう。
これをthundering herd 問題といったり、cache stampede, database stampedeというそうです。
キャッシュ切れた後にががっとくるやつ、です。
A. キャッシュの有効期限が切れる
B. SQL発行
C. SQLの結果を受け取る
D. キャッシュにつっこむ
A-D.の間に大量のリクエストが来ると、重いSQLが走るので困ります。
Kazuhookuさんが書いています。
キャッシュシステムの Thundering Herd 問題
対策としては、以下の2種類の手段があります。
* バックエンドへの同一リクエストを束ねるような仕組みを実装する
* エクスパイヤ以前の残存時間が一定以下となった段階で、キャッシュエントリのアップデートを開始する
昨日memcachedの勉強をしている時のFAQの資料にもいろいろ書いてあったのですが、
いくつか対策方法があるようです。
How to prevent clobbering updates, stampeding requests
The easiest answer is to avoid the problem. Don't set caches to expire, and update them via cron, or as data is updated. This does not eliminate the possibility of a stampede, but removes it from becoming the norm.
最も簡単なのは、cronでキャッシュを更新してキャッシュに有効期限をもうけないこと。stampedeの可能性はなくならないが、標準的に起こる現象ではなくなる。
なくならないっていうのはどういうときに起こりえるんだろう?
他に、
If you want to avoid a stampede if key A expires for its common case (a timeout, for example). Since this is caused by a race condition between the cache miss, and the amount of time it takes to re-fetch and update the cache, you can try shortening the window.
First, set the cache item expire time way out in the future. Then, you embed the "real" timeout serialized with the value. For example you would set the item to timeout in 24 hours, but the embedded timeout might be five minutes in the future.
Then, when you get from the cache and examine the timeout and find it expired, immediately edit the embedded timeout to a time in the future and re-store the data as is. Finally, fetch from the DB and update the cache with the latest value. This does not eliminate, but drastically reduces the amount of time where a stampede can occur.
意訳すると、
0. キャッシュには長めの有効期限を設定しておく
1. キャッシュにつっこむ中身に、自前でつけるほんとの有効期限をいれておく
-
$cache->set( $key, { content => $content, expires => $real_expire_time }, $longer_expiry );
2. キャッシュからデータをとってきて、自前でつけるほんとの有効期限をみて、
有効期限切れだったら、すぐさまちょっとだけ有効期限を長くして(重いSQLをこなすのにかかる時間くらい)、
キャッシュにつっこむ
-
my $dat = $cache->get( $key );
-
if ( $dat->{expires} <time() ) {
-
}
3. 突っ込んだ後、重いSQLを発行
4. 重いSQLの結果をキャッシュにつっこむ
これにより、最初の例ではA-D.の間が問題となっていたのに対して、
2.の中の、cache->getしてからexpiresを更新してcache->setするまでの間の時間だけが、問題になります。
この時間が十分に短いかは、環境によるでしょう。
自分の開発環境では0.01sec程度でした。
この仕組みは、Catalyst::Plugin::PageCacheにbusy_lockというオプションを設定することで使用可能です。
バックエンドへの同一リクエストを束ねるような仕組みを実装する
このやり方も、BradがGearmanでできるよ、的なことを書いています。深追いはしていません。
さらに、他のやり方として、
probabilistic timeout
というのもあるようです。
基本的にはキャッシュからとってくるんだけれど、キャッシュが切れそうになったら、
リクエストに対して確率的に、SQLを発行するリクエストを選択して、キャッシュを更新する。
有効期限に近づくほど確率が100%に増すようにする。
さらにkazuhookuさんがつくったKeyedMutexでは
ウェブサービスのためのMutex - KeyedMutex
-
until ($value = $cache->get($key)) {
-
if (my $lock = $km->lock($key, 1)) {
-
#locked read from DB
-
$value = get_from_db($key);
-
$cache->set($key, $value);
-
last;
-
}
-
}
ロック機構を使うことでDBへのアクセスを排他できます。
でもこのサンプル例だと、cache stampedesは解消できる代わり、get_from_dbの間のリクエストは全部待たされますね。
これとbusy_lockの仕組みを併用するのがいいかもしれない、とか今思った。
有効期限切れのデータを絶対返したくないのか、数秒ならいいのか、get_from_dbにはどれくらい時間がかかるのか、
状況によりそうです。
自分がやりたかったのは、
busy_lockのあるPageCacheもいいけどユーザー毎に違う内容を表示する場合に、scriptタグとかでもう1httpリクエスト増えるのもあれだなぁと思ったので
テンプレの一部のレンダリング結果をキャッシュする仕組みがほしくて
http://github.com/mash/catalyst-plugin-blockcache/tree/master
ここまで書いたけどそれってなんでCatalystプラグインなの?TTプラグインでは?
Template::Plugin::Cache??何それ今知った!
でもT::P::Cacheはbusy_lock無いもん!
Cache::なんとかにしてbusy_lockだけ共通化したい
うーん←今ここ
memcachedのメモリ確保について
on 2009/04/08 20:32, under memcached | Comment
実戦で使ってるmemcachedがいっぱいになってきてるっぽいので勉強中
自分の理解を整理する。
memcached-toolでstatsを見る。
1MB_pagesはその1MB単位がいくつあるか
[homepage@www scripts]$ ./memcached-tool *.*.*.*:11211
# Item_Size Max_age 1MB_pages Count Full?
2 136 B 443801 s 22 169620 yes
3 176 B 550195 s 22 131053 yes
4 224 B 538853 s 10 46810 yes
5 280 B 580837 s 23 86112 yes
6 352 B 725477 s 24 71471 yes
7 440 B 816043 s 14 33362 yes
8 552 B 650550 s 10 18989 yes
9 696 B 734238 s 6 9036 yes
10 872 B 776224 s 7 8414 yes
11 1.1 kB 652671 s 14 13384 yes
12 1.3 kB 747239 s 10 7619 yes
13 1.7 kB 712451 s 8 4872 yes
14 2.1 kB 764616 s 13 6331 yes
15 2.6 kB 547465 s 22 8532 yes
16 3.3 kB 603087 s 11 3410 yes
17 4.1 kB 893787 s 44 10909 yes
18 5.2 kB 492512 s 21 4158 yes
19 6.4 kB 409549 s 20 3160 yes
20 8.1 kB 436414 s 22 2794 yes
21 10.1 kB 435327 s 22 2222 yes
22 12.6 kB 437689 s 19 1539 yes
23 15.8 kB 415113 s 21 1344 yes
24 19.7 kB 421321 s 90 4590 yes
25 24.6 kB 21065 s 77 3157 yes
26 30.8 kB 31859 s 101 3333 yes
27 38.5 kB 528086 s 150 3900 yes
28 48.1 kB 413215 s 132 2772 yes
29 60.2 kB 197636 s 43 731 yes
30 75.2 kB 182637 s 15 195 yes
31 94.0 kB 208702 s 10 99 yes
32 117.5 kB 399556 s 7 54 yes
33 146.9 kB 943288 s 5 28 yes
34 183.6 kB 754818 s 2 10 yes
35 229.5 kB 571672 s 4 16 yes
36 286.9 kB 335096 s 2 4 yes
37 358.6 kB 755830 s 3 6 yes
38 448.2 kB 62570 s 1 2 yes
39 1024.0 kB 279955 s 11 11 yes
全部Full!!
びびる!
FAQ読む
http://code.google.com/p/memcached/wiki/FAQ
memcachedのメモリ確保の方法はこちら
How does memcached's memory allocation work? Why not use malloc/free!? Why the hell does it use slabs!?
http://code.sixapart.com/svn/memcached/trunk/server/doc/memory_management.txt
メモリは1MB単位で確保され(→slab)、Item_Sizeのclassを単位に分割される(→chunks)。
memcachedへのsetの要求に対して、順に分割されたchunks個数分までつっこめる。
この個数分の中で、least recently used (LRU) のキューができる。
この例だと
1MB * 22 / 136Byte = 169620
136Byteのclassが22page(=169620chunks)確保されていて、全部Full
136Byteのclassに割り当てられるようなサイズのデータをsetしようとしたら、
最も過去に使われたchunkが開放されて、そこにつっこむ。
そのカウントがevictions(有効期限の切れていないvalidなデータが消された回数)
Max_ageが最低なところを見ると、
24.6kBのclassを3157個格納していて、その最長有効期限が21065sec=5時間程度
ここもFullになってるってことは、もっと長い有効期限を設定しているのに
evictionsとなって消えていっているのかもしれない。
各slab毎のstatsは見れるのかな?
1.25倍区切りでclassの分割数が決まっていて、setしようとしているメモリサイズを格納するのに必要十分な最低のclassを使う。
140Byteのデータをsetしようとしたら176Byteのclassを使う、というように。
管理用のデータは別換算のようだから次に大きなclassを使うのかもしれない。
管理用のメモリサイズは読み取れなかった。
起動後、setの要求に対して、当てはまるclassのchunksに空きがなければ、
また1つslab(1MB分)を確保して、そのclassに当たるByte数(136とか)で分割してchunksを増やす。
-m
その結果、この例では
38.5 kB のclassが起動後、最大メモリサイズが確保されるまでに一番多く使われたのでしょう。
150MB割り当てられて、
1MB * 150 / 38.5kB = 3989個(実際には3900個になっている残りが管理領域なのか?)
使っている。
早いもの順だと、起動直後からのmemcachedの使い方に比較して、使い方のモードが変わったら、
memcachedの動作中に、頻繁に使用されるclassを分析してclassに対するpageを再割り当てする、
というのが
which is the next feature being worked on
って書いてあるのは実装されたんだろうか。
この文書は Date: Fri, 5 Sep 2003 20:31:03 +0300 のメールらしい。
FITC Toronto 2009でしゃべります
on 2009/03/28 22:36, under flash | Comment
FITC Toronto 2009でしゃべる機会をいただきましたので行って来ます!(まだだけど
Cool Japanese Flash – Side A
ねたはwonderfl build flash onlineです
たーのしみー
FITC Toronto 2009 - Speakers
こういうのに乗るとはねー
宣伝でしたー
Silicon Valleyに来ています jtpa-conf編
on 2009/03/28 22:21, under diary | Comment
もう帰ってきたんですが
JTPAカンファレンスメモ
聞いたことと考えたことをごっちゃに書いています。
■ 梅田望夫
自分の力と時代の力
・世界経済の好況不況
・日本の力
・自分の得意分野の成熟度合い
日本は厳しいよ、自分に投資せよ
マクロでは厳しい、ミクロでは景気いいとこもある
マクロが見えることは大事か
今だったらIT分野に進むか?否。
■ 大澤弘治
entrepreneurship?
1) 恐怖心に打ち勝つ精神力
2) クリエイティブ
3) インテリジェンス
自分に投資
4) 諦めない
「成功する秘訣は成功するまでやめないこと」松下幸之助
「あなたはすぐ諦めていませんか?」
5) チームプレイ
6) 明るいこと
質疑応答が印象深い。
諦めないこと、というのとビジネス的な判断というのは別物
信念みたいなものは諦めないが、ビジネスとして撤退すべきであればする
というのは答えになってないんじゃないかなぁ
判断する時に、情熱をどれくらい定量的に意識するか、ってことなのかなぁ。
例えば月1億の赤字を情熱ではカバーできないけど
月100万なら情熱でカバーできる、みたいな。
■ 金島秀人
23andMe
個人に対する遺伝子解析サービス
個人に提供することで遺伝子のサンプルを集めやすい
BIOのCGM。。。
どんどん情報が集まってくるビジネスモデル
Googleが出資してる。。。なるほど
Googleのビジネスモデルとは情報の量を増やしていけばあるレベルから量が質に転換する
わかっていたようで明言されると新鮮でわかりやすかった
シリコンバレースピリット
・個別の会社ではなく、その業界に就職しているというプロスポーツ選手の意識
・自分の好きなこと、得意なことを仕事にする
・他省略
日本の閉塞感に関するfact
新しい産業が生まれにくい
時価総額TOP100のうち、
アメリカは50%が30年以内にできた会社
日本では1社のみが30年以内にできた会社
今シリコンバレーで投資を受けている分野
・ヘルスケア
・新エネルギー
■ パネルトークとか
シリコンバレーでは起業ってのは人生かけるほどのものではないもっと気軽なもの
・つぶれても有限責任、再出発しやすい
・アウトソースがしやすい
VCがお金をつっこむ
自分のコア業務以外は積極的にアウトソース
さまざまな業務のフリーランスがいる
リスクマネーの定義ができてる
日本は銀行の考え方のVC
担保に対してお金を出す
=リスクをとっているわけではない
アメリカのVC
ビジネスモデルに対して価値を見出して「投資」する
「まず日本で始めて」という考え方を転換しよう
日本は市場環境が悪
要求仕様が高い
市場が下降
エンジニアとマネージャーの給料はキャリアを比べてもほとんどいっしょ
■ 渡辺千賀, 海部美知
「わからないことは、わからない」
「どんなベンチャーが今儲かるか?」「わかってたら自分がやってるわ」
そうだよね
シリコンバレーっていう大きな範囲で、試行錯誤プロセスをしている。
2,3年後を見通すくらいはいいけど10年後なんてぜんぜんわからない
「自転車操業を繰り返しているうちに、
この自転車意外と性能いいじゃん、って自信がつく」

