-
Notifications
You must be signed in to change notification settings - Fork 275
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
Limit the compute job thread pool size #6624
Open
garypen
wants to merge
4
commits into
dev
Choose a base branch
from
garypen/compute-limit
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The router has always observed the APOLLO_ROUTER_NUM_CORES environment variable to restrict the size of the main tokio async job scheduler. We are now enhancing the compute job thread pool to both respect this environment variable and restrict the number of threads in the pool. If the environment variable is not set, then the size of the pool is computed as a fraction of the total number of cores that the router has determined are available. If it is set, then the environment variable is taken as the number of available cores. From this number, let's call it available, the router then uses the following table to size the compute job thread pool: /// available: 1 pool size: 1 /// available: 2 pool size: 1 /// available: 3 pool size: 2 /// available: 4 pool size: 3 /// available: 5 pool size: 4 /// ... /// available: 8 pool size: 7 /// available: 9 pool size: 7 /// ... /// available: 16 pool size: 14 /// available: 17 pool size: 14 /// ... /// available: 32 pool size: 28 /// etc... This table should not be relied upon as an explicit interface, since it may change in the future, but is provided here for informational purposes.
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: a4d6d55042cffd8b0dab3381 |
This comment has been minimized.
This comment has been minimized.
CI performance tests
|
I am going to try backporting it to 1.x so I can run some more perf tests. |
@Mergifyio backport 1.x |
🟠 Waiting for conditions to match
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The router has always observed the APOLLO_ROUTER_NUM_CORES environment variable to restrict the size of the main tokio async job scheduler.
We are now enhancing the compute job thread pool to both respect this environment variable and restrict the number of threads in the pool.
If the environment variable is not set, then the size of the pool is computed as a fraction of the total number of cores that the router has determined are available.
If it is set, then the environment variable is taken as the number of available cores.
From this number, let's call it available, the router then uses the following table to size the compute job thread pool:
/// available: 1 pool size: 1
/// available: 2 pool size: 1
/// available: 3 pool size: 2
/// available: 4 pool size: 3
/// available: 5 pool size: 4
/// ...
/// available: 8 pool size: 7
/// available: 9 pool size: 7
/// ...
/// available: 16 pool size: 14
/// available: 17 pool size: 14
/// ...
/// available: 32 pool size: 28
/// etc...
This table should not be relied upon as an explicit interface, since it may change in the future, but is provided here for informational purposes.