Skip to content

Add thread-core-ratio config option and change default to 1 #11666

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

Merged
merged 3 commits into from
Mar 25, 2025
Merged

Conversation

yawkat
Copy link
Member

@yawkat yawkat commented Mar 19, 2025

We already have options to set the number of threads for event loops explicitly, but none that scale with host core count.

This PR adds a thread-core-ratio config option that allows for dynamically changing event loop thread count based on core count. Netty previously did the same thing when num-threads is 0, but this PR moves that logic to our code.

The default ratio is changed from nettys 2 to 1. A single thread per core reduces jitter and should achieve the same throughput in most scenarios.

We already have options to set the number of threads for event loops explicitly, but none that scale with host core count.

This PR adds a thread-core-ratio config option that allows for dynamically changing event loop thread count based on core count. Netty previously did the same thing when num-threads is 0, but this PR moves that logic to our code.

The default ratio is changed from nettys 2 to 1. A single thread per core reduces jitter and should achieve the same throughput in most scenarios.
@yawkat yawkat added the type: improvement A minor improvement to an existing feature label Mar 19, 2025
@yawkat yawkat added this to the 4.8.8 milestone Mar 19, 2025
@yawkat yawkat merged commit 9a717da into 4.8.x Mar 25, 2025
19 of 20 checks passed
@yawkat yawkat deleted the num-threads branch March 25, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants