Skip to content

[Redis-benchmark] Support zset type#7618

Merged
itamarhaber merged 2 commits intoredis:unstablefrom
ShooterIT:benchmark-zset
Aug 11, 2020
Merged

[Redis-benchmark] Support zset type#7618
itamarhaber merged 2 commits intoredis:unstablefrom
ShooterIT:benchmark-zset

Conversation

@ShooterIT
Copy link
Member

I notice that redis-benchmark doesn't support zset type. But zset is basic data type of redis, so I add zadd and zrem tests.

BTW, redis-benchmark also is useful to test performance for some key/value servers that support redis protocol.

Copy link
Member

@itamarhaber itamarhaber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ShooterIT - good addition and the implementation's good :) One request: please add ZADD to the '-r' usage line

@ShooterIT
Copy link
Member Author

please add ZADD to the '-r' usage line

I can do that @itamarhaber

@ShooterIT
Copy link
Member Author

@itamarhaber @filipecosta90 hi, I think I should remove zrem test because I can't have a good idea to handle deleting inexistent members, do you think so?

@itamarhaber
Copy link
Member

I guess that makes sense... we could benchmark ZMINPOP instead :)

@ShooterIT
Copy link
Member Author

Thanks @itamarhaber I haven't learned redis commands too long time, I didn't know ZPOPMIN just now :). ZPOPMIN can make sense just like SPOP,LPOP.
So I will remove ZREM and add ZOPOMIN.

@ShooterIT ShooterIT requested a review from itamarhaber August 8, 2020 15:10
@daidaotong
Copy link
Contributor

@ShooterIT @itamarhaber this looks like a good change, I just have one concern, the default benchmark test takes a very long time to run, if we adding more tests should this causing it takes longer time? Redis Benchmark also can run with custom command if we append the test directly in the parameter, such as redis-benchmark -n 100000 -q script load "redis.call('set','foo','bar')" do we leave zadd or zrem as default benchmark to run or leave it to be custom? thanks

@itamarhaber
Copy link
Member

@daidaotong good point about time, but I don't see that as a real issue because adding two..eight more tests isn't going to change the run's time by orders of magnitude. I would guess that this wouldn't really affect anyone who's running the benchmark with the defaults... for whatever purpose.

I support the initiative because it seems strange that ZADD isn't present in the default suite - probably an omission rather than intentional. I'm not bent on using ZPOP, but I have nothing against it either.

Semi-related: #7600 - @madolson @yossigo thoughts?

@ShooterIT
Copy link
Member Author

ShooterIT commented Aug 9, 2020

Thanks for your concern @daidaotong I think we should add zrem and zpopmin as defult benchmark. Firstly, zset is the basic data type of redis, we should know its' performace, otherwise, we should test the performace of zadd/zpopmin when we make the size of zset(skiplist actually) bigger/smaller.
For time, I also think it is not a big problem, we may use extra 4s defaultly (qps is 6w if multi-thread is disabled on my machine)

@soloestoy
Copy link
Contributor

This remind me about #4895, but never mind just go on.

BTW, in HSET we need random field instead of random key, what do you think @itamarhaber ?

@ShooterIT
Copy link
Member Author

thanks @soloestoy I also found this, i think we may want to test performance of hash when we expand it by adding more fields

BTW, in HSET we need random field instead of random key, what do you think @itamarhaber ?

@itamarhaber
Copy link
Member

BTW, in HSET we need random field instead of random key, what do you think @itamarhaber ?

Sure, but that's a different "test" altogether - i.e. populating the DB vs populating a nested type.

@ShooterIT
Copy link
Member Author

Yes, but i think 'SET' test already is for populating the DB actually

@soloestoy
Copy link
Contributor

soloestoy commented Aug 11, 2020

Hi @itamarhaber I see there is a pending review request from you, could we just merge this PR and then I can make another new one to discuss the HSET problem.

@itamarhaber
Copy link
Member

Sure - merging & thanks @ShooterIT :)

@itamarhaber itamarhaber merged commit 28a8465 into redis:unstable Aug 11, 2020
@ShooterIT ShooterIT deleted the benchmark-zset branch August 11, 2020 11:47
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Aug 13, 2020
[Redis-benchmark] Support zset type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants