From 82ea1c37c5cce9aaeeee19d0826e36b312e6365f Mon Sep 17 00:00:00 2001 From: Phil Cameron Date: Mon, 30 Jan 2017 15:55:51 -0500 Subject: [PATCH] Make haproxy maxconn configurable The haproxy maxconn (maximum connections) is by default 2000. This was previously 2000. This change makes that configurable through the oadm router --max-connections= option when creating a router. For existing routers the value can be set in the ROUTER_MAX_CONNECTIONS environment variable. If ROUTER_MAX_CONNECTIONS is missing, the deafult (20000) is used. origin PR 12716 bug 1405440 https://bugzilla.redhat.com/show_bug.cgi?id=1405440 --- architecture/core_concepts/routes.adoc | 1 + .../router/default_haproxy_router.adoc | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/architecture/core_concepts/routes.adoc b/architecture/core_concepts/routes.adoc index 1b69c3f7e529..505571feffca 100644 --- a/architecture/core_concepts/routes.adoc +++ b/architecture/core_concepts/routes.adoc @@ -221,6 +221,7 @@ $ oc set env dc/router HAPROXY_ROUTER_SYSLOG_ADDRESS=127.0.0.1 HAPROXY_ROUTER_LO |`*ROUTER_DENIED_DOMAINS*` | | A comma-separated list of domains that the host name in a route can not be part of. No subdomain in the domain can be used either. Overrides option `ROUTER_ALLOWED_DOMAINS`. |`*ROUTER_ENABLE_COMPRESSION*`| false | If `true`, compress responses when possible. |`*ROUTER_LOG_LEVEL*` | warning | The log level to send to the syslog server. +|`*ROUTER_MAX_CONNECTIONS*`| 2000 | Maximum number of concurrent connections. |`*ROUTER_OVERRIDE_HOSTNAME*`| | If set, override the spec.host value for a route with the template in ROUTER_SUBDOMAIN. |`*ROUTER_SERVICE_HTTPS_PORT*` | 443 | Port to listen for HTTPS requests. |`*ROUTER_SERVICE_HTTP_PORT*` | 80 | Port to listen for HTTP requests. diff --git a/install_config/router/default_haproxy_router.adoc b/install_config/router/default_haproxy_router.adoc index b3510cef60a6..d26272d02512 100644 --- a/install_config/router/default_haproxy_router.adoc +++ b/install_config/router/default_haproxy_router.adoc @@ -241,6 +241,30 @@ oc label route key=value $ oc describe dc/ ---- + +[[concurrent-connections]] +Setting the Maximum Number of Concurrent Connections:: + +The default maximum number of connections that can be handled by the router is 20000. +You can change that limit depending on your needs. Too few connections will prevent the +health check from working which causes unneeded restarts. The system needs to be configured +to support the maximum number of connections. The limits shown in 'sysctl fs.nr_open' and +'sysctl fs.file-max' must be large enough or haproxy will not start. + + +When the router is created the --max-connections= option sets the desired limit, + +==== +---- +$ oadm router --max-connections=10000 .... +---- +==== + +The *ROUTER_MAX_CONNECTIONS* environment variable in the router's deployment config can +be edited to change the value. The router pods are restarted with the new value. +If *ROUTER_MAX_CONNECTIONS* is not present the default, 20000, is used. + + [[highly-available-routers]] == Highly-Available Routers