Currently if an Elasticsearch node runs in a container without cgroup's cpu_quota but with cpu_shares, the JVM will think that it has all the host processors available. We use that information to size the thread pools, using all the available threads in a possible multi-tenant host could be translated into CPU oversubscription in the host node.
If we detect that cpu_shares are set in the cgroup FS (through /sys/fs/cgroup/cpu/cpu.shares) we should set node.processors using that value (and ideally -XX:ActiveProcessorCount too). Ideally, we should be able to use a configuration parameter to take into account the maximum allowed over-commit and adjust the number of processors based on that value. The value for node.processors must not be over the available number of processors in the host.
Currently if an Elasticsearch node runs in a container without cgroup's
cpu_quota
but withcpu_shares
, the JVM will think that it has all the host processors available. We use that information to size the thread pools, using all the available threads in a possible multi-tenant host could be translated into CPU oversubscription in the host node. If we detect thatcpu_shares
are set in the cgroup FS (through/sys/fs/cgroup/cpu/cpu.shares
) we should setnode.processors
using that value (and ideally-XX:ActiveProcessorCount
too). Ideally, we should be able to use a configuration parameter to take into account the maximum allowed over-commit and adjust the number of processors based on that value. The value fornode.processors
must not be over the available number of processors in the host.