您好,登錄后才能下訂單哦!
redis自帶一個很好的基準測試工具,記錄一下測試效果,歡迎拍磚。我發現一個奇怪的情況,一些關于開源工具的博客,很少描述當時主機的一些情況,沒有主機部分數據的記錄,是有些不太完整的。
環境介紹
1.redis服務器(虛擬機,IP:192.168.163.156)
1M內存
20G硬盤
Linux操作系統
2.redis 客戶端(虛擬機,IP:192.168.163.146)
1M內存
20G硬盤
3.監控 zabbix (虛擬機,IP:192.168.163.146)
1M內存
20G硬盤
測試了2次
測試記錄
1.請求兩1w,并發數為4
# /usr/local/redis/bin/redis-benchmark -h 192.168.163.156 -p 6379 -c 4 -n 10000 ====== PING_INLINE ====== 10000 requests completed in 0.46 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.77% <= 1 milliseconds 99.98% <= 2 milliseconds 100.00% <= 2 milliseconds 21598.27 requests per second ====== PING_BULK ====== 10000 requests completed in 0.42 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23696.68 requests per second ====== SET ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23364.49 requests per second ====== GET ====== 10000 requests completed in 0.44 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.95% <= 1 milliseconds 100.00% <= 1 milliseconds 22935.78 requests per second ====== INCR ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23201.86 requests per second ====== LPUSH ====== 10000 requests completed in 0.42 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23923.45 requests per second ====== RPUSH ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23148.15 requests per second ====== LPOP ====== 10000 requests completed in 0.44 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 1 milliseconds 22883.29 requests per second ====== RPOP ====== 10000 requests completed in 0.44 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 22883.29 requests per second ====== SADD ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.97% <= 1 milliseconds 100.00% <= 1 milliseconds 23148.15 requests per second ====== SPOP ====== 10000 requests completed in 0.43 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23474.18 requests per second ====== LPUSH (needed to benchmark LRANGE) ====== 10000 requests completed in 0.42 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 23640.66 requests per second ====== LRANGE_100 (first 100 elements) ====== 10000 requests completed in 0.60 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.85% <= 2 milliseconds 99.91% <= 3 milliseconds 100.00% <= 3 milliseconds 16666.67 requests per second ====== LRANGE_300 (first 300 elements) ====== 10000 requests completed in 1.07 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 1 milliseconds 9337.07 requests per second ====== LRANGE_500 (first 450 elements) ====== 10000 requests completed in 1.27 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.88% <= 1 milliseconds 99.97% <= 2 milliseconds 100.00% <= 2 milliseconds 7849.29 requests per second ====== LRANGE_600 (first 600 elements) ====== 10000 requests completed in 1.64 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.72% <= 1 milliseconds 100.00% <= 1 milliseconds 6101.28 requests per second ====== MSET (10 keys) ====== 10000 requests completed in 0.46 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 21978.02 requests per second
LRANGE_600 (first 600 elements) 性能最差,6101.28 requests per second
2.請求兩10w,并發數為4
[root@hadoop1 zabbix]# /usr/local/redis/bin/redis-benchmark -h 192.168.163.156 -p 6379 -c 4 -n 100000 ====== PING_INLINE ====== 100000 requests completed in 4.40 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.94% <= 1 milliseconds 99.98% <= 2 milliseconds 99.99% <= 3 milliseconds 100.00% <= 3 milliseconds 22742.78 requests per second ====== PING_BULK ====== 100000 requests completed in 4.29 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 1 milliseconds 100.00% <= 1 milliseconds 23288.31 requests per second ====== SET ====== 100000 requests completed in 4.38 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 0 milliseconds 22857.14 requests per second ====== GET ====== 100000 requests completed in 4.41 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 3 milliseconds 22665.46 requests per second ====== INCR ====== 100000 requests completed in 4.67 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.95% <= 1 milliseconds 99.98% <= 2 milliseconds 99.99% <= 3 milliseconds 100.00% <= 3 milliseconds 21422.45 requests per second ====== LPUSH ====== 100000 requests completed in 4.30 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 100.00% <= 2 milliseconds 100.00% <= 3 milliseconds 100.00% <= 3 milliseconds 23239.60 requests per second ====== RPUSH ====== 100000 requests completed in 4.33 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 100.00% <= 4 milliseconds 100.00% <= 4 milliseconds 23105.36 requests per second ====== LPOP ====== 100000 requests completed in 4.35 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 100.00% <= 2 milliseconds 100.00% <= 6 milliseconds 100.00% <= 6 milliseconds 22993.79 requests per second ====== RPOP ====== 100000 requests completed in 4.38 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 100.00% <= 1 milliseconds 22836.26 requests per second ====== SADD ====== 100000 requests completed in 4.45 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 2 milliseconds 22461.81 requests per second ====== SPOP ====== 100000 requests completed in 4.39 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 1 milliseconds 100.00% <= 1 milliseconds 22773.86 requests per second ====== LPUSH (needed to benchmark LRANGE) ====== 100000 requests completed in 4.53 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.99% <= 1 milliseconds 99.99% <= 2 milliseconds 100.00% <= 2 milliseconds 22094.56 requests per second ====== LRANGE_100 (first 100 elements) ====== 100000 requests completed in 5.63 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.98% <= 1 milliseconds 99.99% <= 2 milliseconds 99.99% <= 3 milliseconds 100.00% <= 3 milliseconds 17761.99 requests per second ====== LRANGE_300 (first 300 elements) ====== 100000 requests completed in 11.27 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.48% <= 1 milliseconds 99.69% <= 2 milliseconds 99.87% <= 3 milliseconds 99.98% <= 4 milliseconds 100.00% <= 5 milliseconds 100.00% <= 6 milliseconds 100.00% <= 6 milliseconds 8876.26 requests per second ====== LRANGE_500 (first 450 elements) ====== 100000 requests completed in 13.19 seconds 4 parallel clients 3 bytes payload keep alive: 1 98.89% <= 1 milliseconds 99.44% <= 2 milliseconds 99.66% <= 3 milliseconds 99.90% <= 4 milliseconds 99.97% <= 5 milliseconds 100.00% <= 7 milliseconds 100.00% <= 7 milliseconds 7583.23 requests per second ====== LRANGE_600 (first 600 elements) ====== 100000 requests completed in 17.35 seconds 4 parallel clients 3 bytes payload keep alive: 1 99.67% <= 1 milliseconds 99.97% <= 2 milliseconds 99.98% <= 3 milliseconds 100.00% <= 4 milliseconds 5764.69 requests per second ====== MSET (10 keys) ====== 100000 requests completed in 4.56 seconds 4 parallel clients 3 bytes payload keep alive: 1 100.00% <= 3 milliseconds 100.00% <= 3 milliseconds 21939.45 requests per second
最差的是LRANGE_600 ,5764.69 requests per second
主機監控
另外,CPU load和Memory usage基本上沒什么變化。
結論:
redis set,get等類操作,能到到2w吞吐量。
不同的操作類型,對CPU的影響也不同。
奇怪,redis對內存需求較穩定。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。