Redis Hash 的 HSET、HGET、HMSET、HMGET 性能測試


【壓測環境】

操作系統: Ubuntu 14.04 LTS

Linux版本: 3.13.0-24-generic x86_64 GNU/Linux

處理器: 4核 AMD Athlon(tm) II X4 640 Processor @ 800MHz

機器內存:共 8GB,已使用 6GB,未使用 2GB,交換區 未使用

Redis版本:2.8.17

Redis內存:500MB

 

【壓測結果】

壓測原生的 Redis 性能(非Java客戶端),結果如下:

hset  hget 都能在 4ms 之內完成,且每秒並發處理量都在 7.5萬個請求之上;

hmset  hmget 一次操作兩個數據,都能在 5ms 之內完成,且每秒並發處理量都在 7.1萬個請求之上。

 

【參考資料】

Benchmarks​: See how fast Redis is in different platforms. (本文檔很有價值,建議詳細閱讀!!!)

 

【詳細壓測數據】

bert@MS-7641-14102010:/usr/apps/redis/bin$ ./redis-benchmark -r 500000 -n 500000 hset myhash rand_int rand_int rand_int

====== hset myhash rand_int rand_int rand_int ======

500000 requests completed in 6.66 seconds

50 parallel clients

3 bytes payload

keep alive: 1

99.80% <= 1 milliseconds

99.96% <= 2 milliseconds

99.99% <= 3 milliseconds

100.00% <= 3 milliseconds

75108.91 requests per second

 

bert@MS-7641-14102010:/usr/apps/redis/bin$ ./redis-benchmark -r 500000 -n 500000 hget myhash rand_int rand_int

====== hget myhash rand_int rand_int ======

500000 requests completed in 6.62 seconds

50 parallel clients

3 bytes payload

keep alive: 1

99.88% <= 1 milliseconds

99.99% <= 3 milliseconds

100.00% <= 4 milliseconds

100.00% <= 5 milliseconds

100.00% <= 5 milliseconds

75471.70 requests per second

 

bert@MS-7641-14102010:/usr/apps/redis/bin$ ./redis-benchmark -r 500000 -n 500000 hmset myhash rand_int rand_int rand_int rand_int

====== hmset myhash rand_int rand_int rand_int rand_int ======

500000 requests completed in 7.04 seconds

50 parallel clients

3 bytes payload

keep alive: 1

97.18% <= 1 milliseconds

99.89% <= 2 milliseconds

99.96% <= 3 milliseconds

99.99% <= 5 milliseconds

100.00% <= 5 milliseconds

71063.11 requests per second

 

bert@MS-7641-14102010:/usr/apps/redis/bin$ ./redis-benchmark -r 500000 -n 500000 hmget myhash rand_int rand_int rand_int

====== hmget myhash rand_int rand_int rand_int ======

500000 requests completed in 6.82 seconds

50 parallel clients

3 bytes payload

keep alive: 1

99.70% <= 1 milliseconds

99.97% <= 2 milliseconds

99.98% <= 3 milliseconds

99.99% <= 4 milliseconds

100.00% <= 4 milliseconds

73335.29 requests per second


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM