Skip to content
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

Add MaxFlushDelay option #158

Merged
merged 2 commits into from
Dec 10, 2022
Merged

Add MaxFlushDelay option #158

merged 2 commits into from
Dec 10, 2022

Conversation

FZambia
Copy link
Contributor

@FZambia FZambia commented Dec 10, 2022

Relates #156

Adds MaxFlushDelay option to rueidis.ClientOption:

// MaxFlushDelay when greater than zero pauses pipeline write loop for some time (not larger than MaxFlushDelay)
// after each flushing of data to the connection. This gives pipeline a chance to collect more commands to send
// to Redis. Adding this delay increases latency, reduces throughput – but in most cases may significantly reduce
// application and Redis CPU utilization due to less executed system calls. By default, Rueidis flushes data to the
// connection without extra delays. Depending on network latency and application-specific conditions the value
// of MaxFlushDelay may vary, sth like 20 microseconds should not affect latency/throughput a lot but still
// produce notable CPU usage reduction under load.
MaxFlushDelay time.Duration

@FZambia FZambia mentioned this pull request Dec 10, 2022
pipe.go Outdated Show resolved Hide resolved
@rueian rueian merged commit 717c1ad into redis:main Dec 10, 2022
@FZambia FZambia deleted the max_flush_delay branch December 10, 2022 17:07
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.

3 participants