-
Notifications
You must be signed in to change notification settings - Fork 237
add support for resp3 #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- add new command line argument, '--resp', to send HELLO command
at the begining of a connection to set the RESP mode: 2 or 3.
- the redis protocol component updated to support the new RESP 3 types.
exceptional are:
- Push type: Maybe will be added on next phase, but need to understand better
how and what does it mean to benchmark Redis with push commands.
- Streamed strings & Streamed aggregated: Currently not used by Redis.
- remove unused set_authentication() & set_select_db() - unite all the setup state enums of aute, db selection, cluster slots and the new hello to one setup_state enum, as all of them have the same states of none, sent and done.
memtier_benchmark.cpp
Outdated
| { "port", 1, 0, 'p' }, | ||
| { "unix-socket", 1, 0, 'S' }, | ||
| { "protocol", 1, 0, 'P' }, | ||
| { "resp", 1, 0, o_resp }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider extending --protocol instead of adding another flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but for me, it seems more internal configuration under the Redis protocol. and for backport compatibility, we probably need to add another 2 options (redis-resp2, redis-resp3) as the existing one refers to not set resp version at all.
protocol.cpp
Outdated
| if (conf == PROTOCOL_CONF_RESP2 || conf == PROTOCOL_CONF_RESP3) { | ||
| m_resp3 = conf == PROTOCOL_CONF_RESP3; | ||
| size = evbuffer_add_printf(m_write_buf, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to maintain a backwards compatible mode where we don't send HELLO and we assume we're using RESP2? Without it, we'd lose compatibility with Redis <6.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I got it. In the current implementation if the user doesn't add --resp he will get the old behavior (will not get into this piece of code).
| return size; | ||
| } | ||
|
|
||
| bool redis_protocol::aggregate_type(char c) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if these additional branches are going to have some measurable impact on performance, being executed in tight loops. If that's the case, maybe we'd want to subclass redis_protocol into V2 and V3 instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well not sore it is noticeable and that simple benchmark (of memtier-benchmark) will show us something.
regarding your suggestion to subclass it, do you mean that V2 will not have the impact on the performance as V3?
@filipecosta90 WDYT about this performance concern?
- change config->protocol to be one of the PROTOCOL_TYPE enum (instead of char *) - use --protocol to set resp2 or resp3 instead of --resp
at the begining of a connection to set the RESP mode: 2 or 3.
exceptional are:
how and what does it mean to benchmark Redis with push commands.