Latest web development tutorials

Redisの性能試験

達成するために、複数のコマンドを同時に実行することにより、Redisの性能試験。

文法

次のように基本的なコマンドは、パフォーマンス・テストをRedisの:

redis-benchmark [option] [option value]

以下の実施例は、同時に10000要求検出性能が実行されます。

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 同時接続数を指定します。 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 -q フォースはRedisのを終了します。 唯一のクエリ/秒の値を表示
11 --csv CSV形式で出力
12 -l 発生周期、永久検査が行われます
13 -t 唯一のテストコマンドのカンマ区切りのリストを実行します。
14 -I アイドルモード。 Nアイドルを接続し、待つためだけに開きます。

次の例では、我々はRedisの性能をテストするために複数のパラメータを使用します。

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

-qパラメータで上記の例のホスト127.0.0.1、ポート番号は6379で、コマンドの実行が設定され、lpush、10,000件のリクエストは、結果が毎秒実行されたリクエストの数だけを表示できます。