簡単なベンチマークテスト
簡単なベンチマークテストを実行したい場合は、このドキュメントを読んでください。
simple_bench
$ cd ${# your ROMA path #}/ruby/server
$ bin/simple_bench [options] host:port
オプション
名前 | 解説 | デフォルト |
-s, --set | 単にリクエストを設定します | いいえ |
-g, --get | 単にリクエストを取得します | いいえ |
-r, --rand | ランダムなリクエスト(set, get, delete) | Yes |
-n, --num [num] | キーの数 | ∞ |
-t, --threads [num] | スレッドの数 | 1 |
- テストの種類の選択["--set", "--get", "--rand"]を設定しなかった場合、テストの種類は自動的にランダム("--rand")に設定されるでしょう。
- 選択を指定した場合、テストはその選択で実行されるでしょう。
例
-
ランダムなリクエスト&一つのスレッド のテスト
$ bin/simple_bench localhost:10001 Start thread 0 random_request_sender qps=3417 max=0.005633 min=0.000001 ave=0.000293 qps=3397 max=0.004650 min=0.000001 ave=0.000294 qps=3414 max=0.002076 min=0.000001 ave=0.000293 qps=3390 max=0.005044 min=0.000001 ave=0.000295 qps=3422 max=0.002086 min=0.000001 ave=0.000292 qps=3446 max=0.004851 min=0.000001 ave=0.000290 . . .
-
単にリクエストを取得(100,000records) & 複数スレッド のテスト
$ bin/simple_bench -g -n 100000 -t 5 localhost:10001 Start thread 0 Start thread 1 Start thread 2 Start thread 3 Start thread 4 get_sequence get_sequence get_sequence get_sequence get_sequence qps=4779 max=0.013754 min=0.000456 ave=0.000209 qps=4756 max=0.005286 min=0.000539 ave=0.000210 qps=4781 max=0.006381 min=0.000494 ave=0.000209 qps=4764 max=0.007294 min=0.000265 ave=0.000210 qps=4746 max=0.005818 min=0.000456 ave=0.000211 qps=4735 max=0.005363 min=0.000519 ave=0.000211 qps=4739 max=0.005131 min=0.000169 ave=0.000211 qps=4726 max=0.005933 min=0.000452 ave=0.000212 qps=4705 max=0.005285 min=0.000500 ave=0.000213 qps=4749 max=0.006187 min=0.000472 ave=0.000211 simple_bench has done.
ヒント
ROMAはあまりCPUパワーを必要としません。
優先度をメモリサイズに与えた方が良いです。
TokyoCabinetの場合、データはメモリとtcファイル(物理ストレージ)に格納されます。
基本的にROMAはデータを取得する時にメモリにアクセスします。
しかし、もしデータがメモリサイズを超える場合、データの幾らかはtcファイルの中にのみ格納されます。
この場合、物理アクセスが必要になります(つまりメモリアクセスより遅くなります)。