The Little Known Secret of Redis
It’s the redis-benchmark. In Salvatore’s words:
a little known feature of redis-benchmark introduced recently by Pieter Noordhuis is that you can benchmark any command you want (only available in Redis unstable branch, but you can use redis-benchmark from unstable to benchmark Redis 2.4.x):
$ ./redis-benchmark -q -n 100000 zadd sortedset 10 a zadd sortedset 10 a: 152439.02 requests per secondTo compare it with another command:
$ ./redis-benchmark -q -n 100000 set foo bar set foo bar: 153374.23 requests per secondHowever you can say that we are setting again and again the same element. True… but there is an hidden feature of redis-benchmark that allows to randomize arguments:
$ ./redis-benchmark -q -r 100000 -n 100000 zadd sortedset 10 ele:rand:000000000000 zadd sortedset 10 ele:rand:000000000000: 104166.67 requests per second $ redis-cli zcard sortedset (integer) 63202
The same thread also covers the performance of sorted sets in Redis.
Original title and link: The Little Known Secret of Redis (©myNoSQL)