Method: Concurrent.cpu_quota

Defined in:
lib/concurrent-ruby/concurrent/utility/processor_counter.rb

.cpu_quotanil, Float

The maximum number of processors cores available for process scheduling. Returns nil if there is no enforced limit, or a Float if the process is inside a cgroup with a dedicated CPU quota (typically Docker).

Note that nothing prevents setting a CPU quota higher than the actual number of cores on the system.

For performance reasons the calculated value will be memoized on the first call.



209
210
211
# File 'lib/concurrent-ruby/concurrent/utility/processor_counter.rb', line 209

def self.cpu_quota
  processor_counter.cpu_quota
end