memcachedのベンチマーク測定

libmemcachedの付属ツールを使って測定できるということなのでlibmemcachedをインストールして測定してみました。

$ /usr/local/bin/memslap --servers=127.0.0.1:11211 --test set

としたら

memslap: unrecognized option

とか言われて怒られました。
mekeで失敗してた感じなのをスルーしたせいかな?

で下記を実行
これはすんなりいきました。

$ /usr/local/bin/memslap -s 127.0.0.1:11211
servers : 127.0.0.1:11211
threads count: 1
concurrency: 16
run time: 600s
windows size: 10k
set proportion: set_prop=0.10
get proportion: get_prop=0.90
cmd_get: 12312537
cmd_set: 1368071
get_misses: 7783539
written_bytes: 2373588715
read_bytes: 5077038895
object_bytes: 1488461248

Run time: 600.1s Ops: 13680608 TPS: 22798 Net_rate: 11.8M/s



でさらに調べたらもっと簡単そうなのがあったのでそれを利用
http://www.interdb.jp/techinfo/mcb/

コンパイル
gcc -Wall -lpthread -lnsl -o mcb mcb.c

エラーが出る

mcb.c: In function ‘connector_thread’:
mcb.c:529: warning: cast from pointer to integer of different size
mcb.c: In function ‘main’:
mcb.c:859: warning: cast to pointer from integer of different size

どうやら64bit環境のせいらしい。
http://www.programming-magic.com/20081019165052/

malloc.hをincludeして再度コンパイル
あれ?また同じエラー・・・・

でもなぜか使えるようになった。

./mcb -c set -a 127.0.0.1 -p 11211 -t 10 -n 1000 -l 100
condition =>
        connect to 127.0.0.1 TCP port 11211
        command = set
        10 thread run
        send 1000 command a thread, total 10000 command
        data length = 100
result =>
        interval =  0.353254 [sec]
        performance =  28308.236398 [command/sec]
        thread info:
          ave. = 0.284751[sec], min = 0.215646[sec], max = 0.352510[sec]


まだ、memcachedが落ちる問題が解決してないので引き続き調べていきます・・・

とりあえずやり方忘れるからメモ