歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> redis-benchmark性能測試教程

redis-benchmark性能測試教程

日期:2017/3/2 9:54:05   编辑:關於Linux

1、對1.56的redis進行性能測試,請求1000次,每個請求有200的並發客戶端,每個請求的數據大小為10k,僅顯示查詢時間

[sourcecode]

redis-benchmark -h 192.168.1.56 -p 6379 -c 200 -n 1000 -d 10240 -q

結果:

PING_INLINE: 1703.58 requests per second
PING_BULK: 1628.66 requests per second
SET: 1631.32 requests per second
GET: 1594.90 requests per second
INCR: 1655.63 requests per second
LPUSH: 1494.77 requests per second
LPOP: 1584.79 requests per second
SADD: 1615.51 requests per second
SPOP: 1636.66 requests per second
LPUSH (needed to benchmark LRANGE): 1597.44 requests per second
LRANGE_100 (first 100 elements): 1633.99 requests per second
LRANGE_300 (first 300 elements): 175.90 requests per second
LRANGE_500 (first 450 elements): 93.62 requests per second
LRANGE_600 (first 600 elements): 72.69 requests per second
MSET (10 keys): 1652.89 requests per second

[/sourcecode]

redis 性能測試工具可選參數如下所示:

序號 選項 描述 默認值 1 -h 指定服務器主機名 127.0.0.1 2 -p 指定服務器端口 6379 3 -s 指定服務器 socket 4 -c 指定並發連接數 50 5 -n 指定請求數 10000 6 -d 以字節的形式指定 SET/GET 值的數據大小 2 7 -k 1=keep alive 0=reconnect 1 8 -r SET/GET/INCR 使用隨機 key, SADD 使用隨機值 9 -P 通過管道傳輸 <numreq> 請求 1 10 -q 強制退出 redis。僅顯示 query/sec 值 11 –csv 以 CSV 格式輸出 12 -l 生成循環,永久執行測試 13 -t 僅運行以逗號分隔的測試命令列表。 14 -I Idle 模式。僅打開 N 個 idle 連接並等待。

Copyright © Linux教程網 All Rights Reserved