{%- set _workers = ("__CONTROLLER_MAX_WORKERS__" or grains['num_cpus']*2)|int %}
{%- set max_workers = [_workers, 8]|max %}
{%- set max_reqs = ("__CONTROLLER_MAX_QUEUED_REQUESTS__" or 128)|int %}
+{%- set max_tunnels = ("__CONTROLLER_MAX_GATEWAY_TUNNELS__" or 1000)|int %}
{%- set database_host = ("__DATABASE_EXTERNAL_SERVICE_HOST_OR_IP__" or "__DATABASE_INT_IP__") %}
{%- set database_name = "__DATABASE_NAME__" %}
{%- set database_user = "__DATABASE_USER__" %}
MaxConcurrentRailsRequests: {{ max_workers * 2 }}
MaxConcurrentRequests: {{ max_reqs }}
MaxQueuedRequests: {{ max_reqs }}
+ MaxGatewayTunnels: {{ max_tunnels }}
### CONTAINERS
{%- set dispatcher_ssh_privkey = "__DISPATCHER_SSH_PRIVKEY__" %}
#DATABASE_POSTGRESQL_VERSION=
# Performance tuning parameters. If these are not set, workers
-# defaults on the number of cpus and queued requests defaults to 128.
+# defaults on the number of cpus, queued requests defaults to 128
+# and gateway tunnels defaults to 1000.
#CONTROLLER_MAX_WORKERS=
#CONTROLLER_MAX_QUEUED_REQUESTS=
+#CONTROLLER_MAX_GATEWAY_TUNNELS=
# The directory to check for the config files (pillars, states) you want to use.
# There are a few examples under 'config_examples'.
s#__SSL_KEY_AWS_SECRET_NAME__#${SSL_KEY_AWS_SECRET_NAME}#g;
s#__CONTROLLER_MAX_WORKERS__#${CONTROLLER_MAX_WORKERS:-}#g;
s#__CONTROLLER_MAX_QUEUED_REQUESTS__#${CONTROLLER_MAX_QUEUED_REQUESTS:-128}#g;
+ s#__CONTROLLER_MAX_GATEWAY_TUNNELS__#${CONTROLLER_MAX_GATEWAY_TUNNELS:-1000}#g;
s#__MONITORING_USERNAME__#${MONITORING_USERNAME}#g;
s#__MONITORING_EMAIL__#${MONITORING_EMAIL}#g;
s#__MONITORING_PASSWORD__#${MONITORING_PASSWORD}#g;