redis之性能介紹(爲什麼那麼快)

1.官方測試工具

1.1.官網地址

https://redis.io/topics/benchmarks

1.2.redis-benchmark介紹

1.redis-benchmark是我們在安裝redis的時候,自帶的一個命令工具
localhost:~ gaoxinfu$ ls -la /usr/local/bin/ |grep redis
-rwxr-xr-x   1 gaoxinfu  admin    113008  3 17 21:01 redis-benchmark
-rwxr-xr-x   1 gaoxinfu  admin   1353456  3 17 21:01 redis-check-aof
-rwxr-xr-x   1 gaoxinfu  admin   1353456  3 17 21:01 redis-check-rdb
-rwxr-xr-x   1 gaoxinfu  admin    268668  3 17 21:01 redis-cli
lrwxr-xr-x   1 gaoxinfu  admin        12  3 17 21:01 redis-sentinel -> redis-server
-rwxr-xr-x   1 gaoxinfu  admin   1353456  3 17 21:01 redis-server
localhost:~ gaoxinfu$ 

1.2.1.redis-benchmark -q -n 100000

1.-q 標示只是展示查詢值
2.-n 請求數數量,相當於模擬多少次請求

我們可以用上面的工具redis-benchmark去測試本地redis服務器的性能

localhost:~ gaoxinfu$ redis-benchmark -q -n 100000
PING_INLINE: 72392.00
PING_INLINE: 74128.98 requests per second
PING_BULK: 77821.02 requests per second
SET: 76923.08 requests per second                                     #set請求QPS併發數量:每秒76923.08
GET: 77639.75 requests per second                                     #get請求QPS併發數量:每秒77639.75
INCR: 78003.12 requests per second
LPUSH: 77041.60 requests per second
RPUSH: 75987.84 requests per second
LPOP: 77339.52 requests per second
RPOP: 81037.28 requests per second
SADD: 75357.95 requests per second
HSET: 72939.46 requests per second
SPOP: 57012.54 requests per second
LPUSH (needed to benchmark LRANGE): 78369.91 requests per second
LRANGE_100 (first 100 elements): 76923.08 requests per second
LRANGE_300 (first 300 elements): 75815.01 requests per second
LRANGE_500 (first 450 elements): 75414.78 requests per second
LRANGE_600 (first 600 elements): 62774.64 requests per second
MSET (10 keys): 52966.10 requests per second

localhost:~ gaoxinfu$ 
localhost:~ gaoxinfu$ 

其他介紹,參考上面的地址

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章