MB-20834: Use get_available_cpu_count() for executorpool #threads calculation 93/67493/3
authorDave Rigby <daver@couchbase.com>
Thu, 8 Sep 2016 13:32:45 +0000 (14:32 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 28 Sep 2016 12:21:00 +0000 (12:21 +0000)
commit455fe7795091168f0d59c9aff7fa6443aaabf060
tree2b16442306e6f1c9cd5171ec30094bb52ff87099
parentf64c9ef4880f62f1742c2cbf9f9d2af70ae521d5
MB-20834: Use get_available_cpu_count() for executorpool #threads calculation

Use the new Couchbase::get_available_cpu_count() when calculating how
many executor pool threads to create. get_available_cpu_count()
accounts for the number of logical cores a process is allowed to run
on, which is the mechanism cgroups (and hence Docker) uses to limit
the CPUs available to a container.

This fixes the problem of us creating "too many" executorpool threads
under Docker containers which have the --cpuset-cpus option set.

Change-Id: I3e3b91eecc51aea298ae9aceb9e8c6d3f16b7612
Reviewed-on: http://review.couchbase.org/67493
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Well-Formed: buildbot <build@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/executorpool.cc
src/executorpool.h