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: I6b994becf8963020a56902785e2c569553c95a14
changes/27/384527/3
Maksym Yatsenko 6 years ago committed by Alex Schultz
parent
commit
51f5519f11
  1. 4
      manifests/wsgi/apache.pp
  2. 5
      releasenotes/notes/os_workers_for_worker_count-05563e8178495993.yaml
  3. 4
      spec/classes/ceilometer_api_spec.rb
  4. 1
      spec/classes/ceilometer_db_postgresql_spec.rb
  5. 1
      spec/classes/ceilometer_db_sync_spec.rb
  6. 2
      spec/classes/ceilometer_wsgi_apache_spec.rb

4
manifests/wsgi/apache.pp

@ -56,7 +56,7 @@
#
# [*threads*]
# (Optional) The number of threads for the vhost.
# Defaults to $::processorcount.
# Defaults to $::os_workers.
#
# [*ssl_cert*]
# [*ssl_key*]
@ -92,7 +92,7 @@ class ceilometer::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-05563e8178495993.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.

4
spec/classes/ceilometer_api_spec.rb

@ -156,7 +156,7 @@ describe 'ceilometer::api' do
:operatingsystemrelease => '8.0',
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld',
:processorcount => 2 })
})
end
let :platform_params do
@ -175,7 +175,7 @@ describe 'ceilometer::api' do
:operatingsystemmajrelease => '7',
:fqdn => 'some.host.tld',
:concat_basedir => '/var/lib/puppet/concat',
:processorcount => 2 })
})
end
let :platform_params do

1
spec/classes/ceilometer_db_postgresql_spec.rb

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

1
spec/classes/ceilometer_db_sync_spec.rb

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

2
spec/classes/ceilometer_wsgi_apache_spec.rb

@ -4,7 +4,7 @@ describe 'ceilometer::wsgi::apache' do
let :global_facts do
{
:processorcount => 42,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld'
}

Loading…
Cancel
Save