-
Notifications
You must be signed in to change notification settings - Fork 23.5k
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
Optimize: set max write len to NET_MAX_WRITES_PER_EVENT when writing to client. #5263
base: unstable
Are you sure you want to change the base?
Conversation
In case that we have a very long string value to send to client in one write().
Thanks @0xtonyxia, pinging @oranagra and @soloestoy on that as well to have another POV. Did you observe this in practice? Because AFAIK this should not be needed, anyway write() against a non-blocking socket should be limited to filling kernel socket buffer, so it is very unlikely to cause any delay. Maybe there are other motivations for this PR? |
I agree with what Antirez wrote, @0xtonyxia please let us know if there's something we're missing. |
@0xtonyxia i don't follow.. |
@oranagra Sorry, i didn't explain it clearly. The test is executed before my modification, that is the vanilla version. In the vanilla version, let's say we have a 10MB value to send to the client,the Of course, after this first write call, redis will stop writing to the socket because the length of total data written exceeds |
The bottom line of this fix is that it'll break up large writes with a single system call into multiple system calls. I think for the normal use case we want to avoid this. Since this is old and I'm not to sure about this I'm marking to be closed. Waiting for a response... |
|
In case that we have a very long string value to send to client
in one write().