what's wrong with my case when using redis-benchmark to test specific command

349 views
Skip to first unread message

foxracle

unread,
Dec 8, 2013, 10:55:37 PM12/8/13
to redi...@googlegroups.com
I want to benchmark the command ZRANGEBYSCORE with big sorted set(10 mill),
first, according to http://redis.io/topics/benchmarks, I tried it with -t option, it seems did not work

redis-benchmark -n 100000 -t ZRANGEBYSCORE TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 10000000,ZCARD TestUserBattleRank:TEST1000W
====== TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 10000000,ZCARD TestUserBattleRank:TEST1000W ======
  100000 requests completed in 5.12 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1
44.52% <= 1 milliseconds
75.09% <= 2 milliseconds
98.26% <= 3 milliseconds
99.98% <= 4 milliseconds
99.99% <= 7 milliseconds
99.99% <= 8 milliseconds
100.00% <= 8 milliseconds
19542.70 requests per second


so I tried another method found here: http://download.redis.io/redis-stable/src/redis-benchmark.c 
" Benchmark a specific command line:\n"
" $ redis-benchmark -r 10000 -n 10000 eval 'return redis.call(\"ping\")' 0\n\n"

it seems works, but the result confused me.
according to http://redis.io/commands/zrangebyscore, Time complexity: O(log(N)+M) 
but the benchmark result seem did not support that, Is there something wrong with my test?
BTW,  TestUserBattleRank:TEST1000W is a sorted set with 10 million members and the score is from 0 to 9999999.

redis-benchmark -n 100000 eval 'return redis.call(\"ZRANGEBYSCORE TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 1\")' 0
====== eval return redis.call(\"ZRANGEBYSCORE TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 1\") 0 ======
  100000 requests completed in 9.28 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1
20.64% <= 1 milliseconds
42.58% <= 2 milliseconds
64.21% <= 3 milliseconds
85.83% <= 4 milliseconds
99.99% <= 5 milliseconds
100.00% <= 5 milliseconds
10779.35 requests per second 

redis-benchmark -n 100000 eval 'return redis.call(\"ZRANGEBYSCORE TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 10000000\")' 0
====== eval return redis.call(\"ZRANGEBYSCORE TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 10000000\") 0 ======
  100000 requests completed in 9.30 seconds
  50 parallel clients
  3 bytes payload
  keep alive: 1
20.53% <= 1 milliseconds
42.46% <= 2 milliseconds
64.08% <= 3 milliseconds
85.65% <= 4 milliseconds
99.92% <= 5 milliseconds
99.95% <= 6 milliseconds
99.97% <= 7 milliseconds
99.98% <= 8 milliseconds
99.99% <= 9 milliseconds
100.00% <= 9 milliseconds
10753.84 requests per second

Didier Spezia

unread,
Dec 9, 2013, 5:20:10 AM12/9/13
to redi...@googlegroups.com

Well, yes: all your command lines are wrong in some (different) ways.

> redis-benchmark -n 100000 -t ZRANGEBYSCORE TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 10000000,ZCARD TestUserBattleRank:TEST1000W

It cannot work since -t option is supposed to refer to test names, not arbitrary redis commands.

> redis-benchmark -n 100000 eval 'return redis.call(\"ZRANGEBYSCORE TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 1\")' 0

It cannot work since the command argument of redis.call must be separated by using different parameters.
And you do not need to wrap a command into a Lua script to benchmark it.

With all these commands, you probably only benchmark Redis error management.

You should probably run something like that:

$ redis-benchmark -n 100000 ZRANGEBYSCORE TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 1
$ redis-benchmark -n 100000 ZRANGEBYSCORE TestUserBattleRank:TEST1000W 1 10000000 LIMIT 0 10000000

Regards,
Didier.

foxracle

unread,
Dec 9, 2013, 9:43:58 PM12/9/13
to redi...@googlegroups.com
Thanks for very much
It works!!

在 2013年12月9日星期一UTC+8下午6时20分10秒,Didier Spezia写道:
Reply all
Reply to author
Forward
0 new messages