云Redis性能测试

本地redis(规格2核16G)与云服务redis(华为云或阿里云等,规格1G和16G)的性能对比。

第1个对比:内存规格都是16G时,1000字节时的写入结果

可以看到,在1000字节时性能都差不多

1.1 本地localhost的redis测试结果

/usr/local/redis/bin/redis-benchmark -h 127.0.0.1 -p 6379 -t set -c 100 -n 10000 -d 1000
====== SET ======
  10000 requests completed in 0.10 seconds
  100 parallel clients
  1000 bytes payload
  keep alive: 1

100.00% <= 0 milliseconds
104166.66 requests per second

 

1.2 云redis测试结果

/usr/local/redis/bin/redis-benchmark -h 192.168.0.102 -p 6379 -t set -c 100 -n 10000 -d 1000
====== SET ======
  10000 requests completed in 0.11 seconds
  100 parallel clients
  1000 bytes payload
  keep alive: 1

53.25% <= 1 milliseconds
99.77% <= 2 milliseconds
99.81% <= 4 milliseconds
100.00% <= 4 milliseconds
90090.09 requests per second

第2个对比:内存规格都是16G时,100000字节时的写入结果

可以看到,云redis的速度就

2.1 本地localhost的redis测试结果

 /usr/local/redis/bin/redis-benchmark -h 127.0.0.1 -p 6379 -t set -c 100 -n 10000 -d 100000
====== SET ======
  10000 requests completed in 0.58 seconds
  100 parallel clients
  100000 bytes payload
  keep alive: 1
……
17211.71 requests per second

 

2.2 云redis测试结果

/usr/local/redis/bin/redis-benchmark -h 192.168.0.102 -p 6379 -t set -c 100 -n 10000 -d 100000
====== SET ======
10000 requests completed in 13.68 seconds
100 parallel clients
100000 bytes payload
keep alive: 1
……
730.94 requests per second

第3个对比:都是同一个云Redis,规格1G与16G时,100000字节时的写入结果

上面已有16G的测试结果,下面再附上1G的

/usr/local/redis/bin/redis-benchmark -h 192.168.0.102 -p 6379 -t set -c 100 -n 10000 -d 100000
====== SET ======
10000 requests completed in 46.85 seconds
……
213.42 requests per second

 

 

写入的值如果是1000字节以内的,差别不大。如果是大于1000字节的,特别是到了100000,就太慢了。

0 回复

发表评论

Want to join the discussion?
Feel free to contribute!

发表评论

电子邮件地址不会被公开。 必填项已用*标注