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
feature request: allow float for process count #6244
Comments
- @count = Integer(env["SIDEKIQ_COUNT"] || Etc.nprocessors)
+ @count = Float(env["SIDEKIQ_COUNT"] || Etc.nprocessors).round This will round to the nearest integer: 2.4 -> 2 and 2.5 -> 3. wdyt? |
i like it pros:
cons:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my environment, the number of cpus on a container is available in an environment variable,
CONTAINER_CPU_SHARE
.I would like to pass this to
SIDEKIQ_COUNT
problem is, it can be a "half cpu", e.g.
"2.5"
Maybe sidekiq could accept this and round up, with something like
.to_f.ceil
?I would vote for rounding up, to take full advantage of the half cpu. This is on the side of slightly higher memory use, but my uninformed guess is most users who are passing in a value would be savvy enough to be okay with that.
The text was updated successfully, but these errors were encountered: