Merge "Cap the number of worker threads"

This commit is contained in:
Jenkins 2017-03-10 14:16:03 +00:00 committed by Gerrit Code Review
commit 0dad1e4fbd
3 changed files with 23 additions and 6 deletions

View File

@ -178,6 +178,13 @@ swift_rabbitmq_telemetry_servers: "127.0.0.1"
swift_rabbitmq_telemetry_use_ssl: "False" swift_rabbitmq_telemetry_use_ssl: "False"
## General Swift configuration ## General Swift configuration
# We are not capping the default value for these swift variables which define
# the number of worker threads for each of the swift services (except the swift
# proxy workers when proxy is in a container) because of the performace impact
# that may be seen due to capping worker threads for swift services.
# We would like to calculate the default value using vCPUs for good performance
# of swift services.
# If ``swift_account_server_replicator_workers`` is unset the system will use half the number # If ``swift_account_server_replicator_workers`` is unset the system will use half the number
# of available VCPUS to compute the number of api workers to use. # of available VCPUS to compute the number of api workers to use.
# swift_account_server_replicator_workers: 16 # swift_account_server_replicator_workers: 16
@ -203,8 +210,13 @@ swift_rabbitmq_telemetry_use_ssl: "False"
# swift_object_server_workers: 16 # swift_object_server_workers: 16
# If ``swift_proxy_server_workers`` is unset the system will use half the number # If ``swift_proxy_server_workers`` is unset the system will use half the number
# of available VCPUS to compute the number of api workers to use. # of available VCPUS to compute the number of api workers to use. Capping this
# swift_proxy_server_workers: 16 # value at 16 if the swift proxy is in a container and user did not define
# this variable.
swift_proxy_server_workers_max: 16
swift_proxy_server_workers_not_capped: "{{ [ansible_processor_vcpus|default(2) // 2, 1] | max }}"
swift_proxy_server_workers_capped: "{{ [swift_proxy_server_workers_max, swift_proxy_server_workers_not_capped|int] | min }}"
swift_proxy_server_workers: "{{ (inventory_hostname == physical_host) | ternary(swift_proxy_server_workers_not_capped, swift_proxy_server_workers_capped) }}"
# These are the storage addresses used to define the networks for swift storage and replication # These are the storage addresses used to define the networks for swift storage and replication
# These are calculated by the tasks based on the "storage_network" and "replication_network" values # These are calculated by the tasks based on the "storage_network" and "replication_network" values

View File

@ -0,0 +1,8 @@
---
features:
- Capping the default value for the variable ``swift_proxy_server_workers``
to 16 when the user doesn't configure this variable and if the swift proxy
is in a container. Default value is half the number of vCPUs available on
the machine if the swift proxy is not in a container. Default value is half
the number of vCPUs available on the machine with a capping value of 16
if the proxy is in a container.

View File

@ -1,14 +1,11 @@
# {{ ansible_managed }} # {{ ansible_managed }}
{% set _api_threads = ansible_processor_vcpus|default(2) // 2 %}
{% set api_threads = _api_threads if _api_threads > 0 else 1 %}
[DEFAULT] [DEFAULT]
# Disable stderr logging # Disable stderr logging
use_stderr = False use_stderr = False
bind_ip = 0.0.0.0 bind_ip = 0.0.0.0
bind_port = {{ swift_proxy_port }} bind_port = {{ swift_proxy_port }}
workers = {{ swift_proxy_server_workers | default(api_threads) }} workers = {{ swift_proxy_server_workers }}
user = {{ swift_system_user_name }} user = {{ swift_system_user_name }}
log_facility = LOG_LOCAL1 log_facility = LOG_LOCAL1