Redis-ベンチマーク
Redisベンチマークは、n個のコマンドを同時に実行してRedisのパフォーマンスをチェックするユーティリティです。
構文
以下は、Redisベンチマークの基本的な構文です。
redis-benchmark [option] [option value]
例
次の例では、100000コマンドを呼び出してRedisをチェックします。
redis-benchmark -n 100000
PING_INLINE: 141043.72 requests per second
PING_BULK: 142857.14 requests per second
SET: 141442.72 requests per second
GET: 145348.83 requests per second
INCR: 137362.64 requests per second
LPUSH: 145348.83 requests per second
LPOP: 146198.83 requests per second
SADD: 146198.83 requests per second
SPOP: 149253.73 requests per second
LPUSH (needed to benchmark LRANGE): 148588.42 requests per second
LRANGE_100 (first 100 elements): 58411.21 requests per second
LRANGE_300 (first 300 elements): 21195.42 requests per second
LRANGE_500 (first 450 elements): 14539.11 requests per second
LRANGE_600 (first 600 elements): 10504.20 requests per second
MSET (10 keys): 93283.58 requests per second
以下は、Redisベンチマークで使用可能なオプションのリストです。
シニア番号 | オプション | 説明 | デフォルト値 |
---|---|---|---|
1 | -h | サーバーのホスト名を指定します | 127.0.0.1 |
2 | -p | サーバーポートを指定します | 6379 |
3 | -s | サーバーソケットを指定します | |
4 | -c | 並列接続の数を指定します | 50 |
5 | -n | リクエストの総数を指定します | 10000 |
6 | -d | SET / GET値のデータサイズをバイト単位で指定します | 2 |
7 | -k | 1 =キープアライブ、0 =再接続 | 1 |
8 | -r | SET / GET / INCRにはランダムキーを使用し、SADDにはランダム値を使用します | |
9 | -p | パイプライン<numreq>リクエスト | 1 |
10 | -h | サーバーのホスト名を指定します | |
11 | -q | 静かにRedisを強制します。クエリ/秒の値を表示するだけです | |
12 | --csv | CSV形式で出力 | |
13 | -l | ループを生成し、テストを永久に実行します | |
14 | -t | テストのコンマ区切りリストのみを実行します | |
15 | -I | 起動維持モード。N個のアイドル接続を開いて待つだけです |
例
次の例は、Redisベンチマークユーティリティの複数の使用オプションを示しています。
redis-benchmark -h 127.0.0.1 -p 6379 -t set,lpush -n 100000 -q
SET: 146198.83 requests per second
LPUSH: 145560.41 requests per second