Browse Source

Change worker defaults to ::os_workers

This patch changes the default worker count from ::processorcount to the
new ::os_workers fact. ::os_workers is based on the number of processors
(currently cpu/4) but is capped at a maximum of 8 worker processors.
This is a much more reasonable default in general and prevents excessive
resource consumption on systems with a large number of CPUs.

Change-Id: Id7c5f3df32b4f350d93ed85b6293fe69e64c2cc3
changes/56/383756/1
Maksym Yatsenko 6 years ago
parent
commit
d3b12f6937
  1. 4
      manifests/wsgi/apache.pp
  2. 5
      releasenotes/notes/os_workers_for_worker_count-d1ea2ef2beb0d686.yaml
  3. 1
      spec/classes/aodh_api_spec.rb
  4. 2
      spec/classes/aodh_db_sync_spec.rb
  5. 1
      spec/classes/aodh_evaluator_spec.rb
  6. 2
      spec/classes/aodh_wsgi_apache_spec.rb

4
manifests/wsgi/apache.pp

@ -54,7 +54,7 @@
#
# [*threads*]
# (optional) The number of threads for the vhost.
# Defaults to $::processorcount
# Defaults to $::os_workers
#
# [*ssl_cert*]
# [*ssl_key*]
@ -90,7 +90,7 @@ class aodh::wsgi::apache (
$ssl_crl_path = undef,
$ssl_crl = undef,
$ssl_certs_dir = undef,
$threads = $::processorcount,
$threads = $::os_workers,
$priority = '10',
) {

5
releasenotes/notes/os_workers_for_worker_count-d1ea2ef2beb0d686.yaml

@ -0,0 +1,5 @@
---
other:
- Parameters that control the number of spawned child processes for
distributing processing have had their default value changed from
::processorcount to ::os_workers.

1
spec/classes/aodh_api_spec.rb

@ -189,7 +189,6 @@ describe 'aodh::api' do
let (:facts) do
facts.merge!(OSDefaults.get_facts({
:fqdn => 'some.host.tld',
:processorcount => 2,
:concat_basedir => '/var/lib/puppet/concat'
}))
end

2
spec/classes/aodh_db_sync_spec.rb

@ -22,7 +22,7 @@ describe 'aodh::db::sync' do
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts({
:processorcount => 8,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end

1
spec/classes/aodh_evaluator_spec.rb

@ -90,7 +90,6 @@ describe 'aodh::evaluator' do
let (:facts) do
facts.merge!(OSDefaults.get_facts({
:fqdn => 'some.host.tld',
:processorcount => 2,
:concat_basedir => '/var/lib/puppet/concat'
}))
end

2
spec/classes/aodh_wsgi_apache_spec.rb

@ -79,7 +79,7 @@ describe 'aodh::wsgi::apache' do
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({
:processorcount => 42,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld'
}))

Loading…
Cancel
Save