Conversation
| # +Concurrent.available_processor_count+ (requires the concurrent-ruby gem). | ||
| # If available processor count is a Float (cpu quotas), we will round down. | ||
| # | ||
| # @note Cluster mode only. |
There was a problem hiding this comment.
This seems wrong to me when workers 0 can be used to set single mode.
joshuay03
left a comment
There was a problem hiding this comment.
It's probably not that great that you MUST use the ENV var in order to get this neat behavior.
💯
LGTM overall. Just some feedback on doc changes.
| workers :auto | ||
| ``` | ||
|
|
||
| Note that threads are still used in cluster mode, and the `-t` thread flag setting is per worker, so `-w 2 -t 16:16` will spawn 32 threads in total, with 16 in each worker process. |
There was a problem hiding this comment.
The positioning of this line now seems awkward. It might read better before 'When using a config file ...'?
| return Integer(::Concurrent.available_processor_count) | ||
| end | ||
|
|
||
| Integer(value) |
There was a problem hiding this comment.
Maybe update with the following:
if value == :auto || value == 'auto'
require_processor_counter
Integer(::Concurrent.available_processor_count)
else
Integer(value)
endThere was a problem hiding this comment.
|
Hum, not sure if you are aware, but I did implement But perhaps this is outdated info? Did you test the common providers? |
Should we care about this? ...if single mode happens, and you have hooks for cluster mode, you will start to see warnings about |
0339c26 to
98c0870
Compare
98c0870 to
0dfa006
Compare
0dfa006 to
c760826
Compare
Should it ever be? |
|
some environments don't reveal the cpu share, and cgroups v1this is -1 cgroups v2this is not present puma could introspect this and conclude "my cores are being limited but i don't know what the limit is" |
aptible and shipyard. i bet @bueller would be happy to give you a free environment to play with on shipyard
in all environments except prod, definitely raise in systems i've worked with, raising in prod is also fine. halts the deploy, user sees what error is and fixes it. but could also fall back to 1 process and still be in cluster mode (in case there are cluster-specific behaviors the user is expecting). and log an error. |
It's probably not that great that you MUST use the ENV var in order to get this neat behavior.
I noticed that this rounds down, which means a cpu quota of 512 will potentially put you into single mode (rounds 0.5 to 0). That's a bit weird but probably not hit often enough IRL to matter (and it's kinda what I would prefer to happen anyway).