Update os_workers to have other options
Adding additional options for os_workers.rb: os_workers_small os_workers_large os_workers will provide response times close to what $::processorcount had (with two sockets machines). os_workers_small will be the existing calculation. os_workers_large can be used where services are distributed across multiple machines and high worker count is not a concern. Closes-bug: #1650424 Change-Id: I5dce760044d49ef9e3c88736c73cc267fd039ae7
This commit is contained in:
parent
d91a4c7b36
commit
e6b658bd00
@ -11,10 +11,40 @@
|
|||||||
# This fact can be overloaded by an external fact from /etc/factor/facts.d if
|
# This fact can be overloaded by an external fact from /etc/factor/facts.d if
|
||||||
# a user would like to provide their own default value.
|
# a user would like to provide their own default value.
|
||||||
#
|
#
|
||||||
Facter.add(:os_workers) do
|
Facter.add(:os_workers_small) do
|
||||||
has_weight 100
|
has_weight 100
|
||||||
setcode do
|
setcode do
|
||||||
processors = Facter.value('processorcount')
|
processors = Facter.value('processorcount')
|
||||||
[ [ (processors.to_i / 4), 2 ].max, 8 ].min
|
[ [ (processors.to_i / 4), 2 ].max, 8 ].min
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# The value above for os_workers performs 3x worse in many cases compared to
|
||||||
|
# the prevuous default of $::processorcount.
|
||||||
|
#
|
||||||
|
# Based on performance data [1], the following calculation is within 1-2%.
|
||||||
|
#
|
||||||
|
# The value for os_workers is max between '(<# processors> / 2)' and '2' with
|
||||||
|
# a cap of 12.
|
||||||
|
#
|
||||||
|
# [1] http://elk.browbeatproject.org:80/goto/a23307fd511e314b975dedca6f65425d
|
||||||
|
#
|
||||||
|
Facter.add(:os_workers) do
|
||||||
|
has_weight 100
|
||||||
|
setcode do
|
||||||
|
processors = Facter.value('processorcount')
|
||||||
|
[ [ (processors.to_i / 2), 2 ].max, 12 ].min
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# For cases where services are not co-located together (ie monolithic).
|
||||||
|
#
|
||||||
|
Facter.add(:os_workers_large) do
|
||||||
|
has_weight 100
|
||||||
|
setcode do
|
||||||
|
processors = Facter.value('processorcount')
|
||||||
|
[ (processors.to_i / 2) ]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
12
releasenotes/notes/os_workers-fact-0ce731f0536c2792.yaml
Normal file
12
releasenotes/notes/os_workers-fact-0ce731f0536c2792.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Moved existing $::os_workers to $::os_workers_small
|
||||||
|
- Updated $::os_workers to have a value between '2' and '12'.
|
||||||
|
The value of this fact is the larger value between '2'
|
||||||
|
and the number of processors divided by '2' but will not
|
||||||
|
exceed '12'.
|
||||||
|
- Created fact $::os_workers_large to have a value of number
|
||||||
|
of processors divided by '2'
|
||||||
|
fixes:
|
||||||
|
- bug 1650424 The current calculation for os_workers negatively
|
||||||
|
impacts api response times
|
Loading…
Reference in New Issue
Block a user