Redisのパフォーマンステスト
Redis のパフォーマンス テストは、複数のコマンドを同時に実行することで実現されます。
構文
Redis パフォーマンス テストの基本コマンドは次のとおりです:
redis-benchmark [option] [option value]
インスタンス
次の例では、パフォーマンスを検出するために 10,000 のリクエストを同時に実行します:
redis-benchmark -n 10000 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 | 同時接続 | 5 0 |
5 | -n | リクエスト数を指定 | 10000 |
6 | -d | SET/GET値のデータサイズをバイト単位で指定 | 2 |
7 | -k | 1=キープアライブ 0=再接続 | 1 |
8 | -r | SET/GET/INCRはランダムキーを使用し、SADDはランダム値を使用します | |
9 | -P | Pipe <numreq> リクエスト | 1 |
10 | -q | Redis を強制終了します。クエリ/秒の値のみを表示 | |
11 | --csv | CSV形式で出力 | |
-l | テストを永続的に実行するためのループを生成します | 13 | |
テストコマンドのカンマ区切りリストのみを実行します。 | 14 | ||
アイドルモード。 N 個のアイドル接続のみを開いて待機します。 |
redis-benchmark -h 127.0.0.1 -p 6379 -t set,lpush -n 10000 -q SET: 146198.83 requests per second LPUSH: 145560.41 requests per second