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 Concurrent.usable_processor_count that is cgroups aware #1038
Merged
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
eregon
reviewed
Jan 29, 2024
eregon
reviewed
Jan 29, 2024
casperisfine
force-pushed
the
cgroup-support
branch
from
January 29, 2024 16:21
bfd027b
to
298d696
Compare
Arf:
I'll fix 2.3 compat. |
casperisfine
force-pushed
the
cgroup-support
branch
2 times, most recently
from
January 29, 2024 16:43
2ad87f7
to
aecdebb
Compare
eregon
reviewed
Jan 29, 2024
eregon
reviewed
Feb 1, 2024
casperisfine
force-pushed
the
cgroup-support
branch
from
February 1, 2024 11:11
aecdebb
to
165b061
Compare
eregon
reviewed
Feb 1, 2024
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.
Looks good, just need a bit more documentation care.
Closes: ruby-concurrency#1035 A running gag since the introduction of containerization is software that starts one process per logical or physical core while running inside a container with a restricted CPU quota and totally blowing up memory usage in containerized environments. The proper question to ask is how many CPU cores are usable, not how many the machine has. To do that we have to read the cgroup info from `/sys`. There is two way of doing it depending on the version of cgroups used. Co-Authored-By: usiegl00 <50933431+usiegl00@users.noreply.github.com>
casperisfine
force-pushed
the
cgroup-support
branch
from
February 1, 2024 12:25
165b061
to
1fd2bbc
Compare
eregon
approved these changes
Feb 1, 2024
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.
Thank you!
eregon
reviewed
Feb 1, 2024
Thanks! |
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.
Closes: #1035
A running gag since the introduction of containerization is software that starts one process per logical or physical core while running inside a container with a restricted CPU quota and totally blowing up memory usage in containerized environments.
The proper question to ask is how many CPU cores are usable, not how many the machine has. To do that we have to read the cgroup info from
/sys
. There is two way of doing it depending on the version of cgroups used.Co-Authored-By: @usiegl00