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

Use cgroups aware processor count by default #1

Closed
wants to merge 1 commit into from

Conversation

y-yagi
Copy link
Owner

@y-yagi y-yagi commented Aug 8, 2024

In containerized environments, a number of CPU cores isn't the same as the available CPUs. In this case, we need to consider cgroups.

concurrent-ruby now has the method to get that since v1.3.1. I think it's better to use this for setting more container environment friendly default value.

Ref: ruby-concurrency/concurrent-ruby#1038

@y-yagi y-yagi closed this Aug 8, 2024
@y-yagi y-yagi reopened this Aug 8, 2024
@y-yagi y-yagi force-pushed the use_available_processor_count branch 2 times, most recently from f336692 to c47a37d Compare August 8, 2024 02:25
In containerized environments, a number of CPU cores isn't the
same as the available CPUs. In this case, we need to consider cgroups.

`concurrent-ruby` now has the method to get that since v1.3.1. I think it's better
to use this for setting more container environment friendly default value.
Ref: ruby-concurrency/concurrent-ruby#1038

I keep `Parallel.processor_count` as is to keep supporting setting
processor count via env(`PARALLEL_PROCESSOR_COUNT`).
@y-yagi y-yagi force-pushed the use_available_processor_count branch from c47a37d to f7bfe1b Compare August 8, 2024 02:42
@y-yagi y-yagi closed this Aug 8, 2024
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.

1 participant