Memcached for Win32の起動

memcachedはデフォルトでメモリを64MBを使用する設定になっている。
割当容量は起動時のオプション-mオプションで制御できる。

c:\memcached\memcached.exe -m 100 -d start

一杯になった時は古いデータから順次削除される。
最初から-mオプションの値を超えるデータ量を 1度のset()で保存しようとすると保存してくれないので注意が必要。
http://diary.godtomato.net/takefumi/2006/05/01_04.html
http://blog.livedoor.jp/nipotan/archives/50499687.html


その他にも-cオプションで接続数、-uオプションで実行ユーザ、-pで待ち受けるポートの設定をすることができる。

c:\memcached\memcached.exe -c 2048 -u memcached -p 11212 -m 512 -d start

その他オプションは-helpオプションで確認できる。

C:\memcached>memcached -help
memcached 1.2.0-rc1
-p <num>          port number to listen on
-s <file>     unix socket path to listen on (disables network support)
-l <ip_addr>      interface to listen on, default is INDRR_ANY
-d start          tell memcached to start
-d restart        tell running memcached to do a graceful restart
-d stop|shutdown  tell running memcached to shutdown
-d install        install memcached service
-d uninstall      uninstall memcached service
-r                maximize core file limit
-u <username>     assume identity of <username> (only when run as root)
-m <num>          max memory to use for items in megabytes, default is 64 MB
-M                return error on memory exhausted (rather than removing items)
-c <num>          max simultaneous connections, default is 1024
-k                lock down all paged memory
-v                verbose (print errors/warnings while in event loop)
-vv               very verbose (also print client commands/reponses)
-h                print this help and exit
-i                print memcached and libevent license
-b                run a managed instanced (mnemonic: buckets)
-P <file>         save PID in <file>, only used with -d option
-f <factor>   chunk size growth factor, default 1.25
-n <bytes>    minimum space allocated for key+value+flags, default 48