From 73dee1dc7fe92952af203f81df88932dccfa0602 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Fri, 6 Feb 2015 18:16:31 +0000 Subject: [PATCH] Stab at making our lower mem proxies happier so they don't nagios flood us --- inventory/group_vars/proxies | 7 ++++++- inventory/group_vars/proxies-stg | 5 +++++ inventory/host_vars/proxy03.fedoraproject.org | 5 +++++ roles/httpd/proxy/tasks/main.yml | 4 ++-- .../proxy/{files/httpd.conf => templates/httpd.conf.j2} | 4 ++-- 5 files changed, 20 insertions(+), 5 deletions(-) rename roles/httpd/proxy/{files/httpd.conf => templates/httpd.conf.j2} (99%) diff --git a/inventory/group_vars/proxies b/inventory/group_vars/proxies index 7dd5198663..2846f839c4 100644 --- a/inventory/group_vars/proxies +++ b/inventory/group_vars/proxies @@ -1,9 +1,14 @@ --- # Define resources for this group of hosts here. lvm_size: 30000 -mem_size: 4192 +mem_size: 8192 num_cpus: 4 +# This is used in the httpd.conf to determine the value for serverlimit and +# maxrequestworkers. On 8gb proxies, 900 seems fine. But on 4gb proxies, this +# should be lowered in the host vars for that proxy. +maxrequestworkers: 900 + tcp_ports: [ # For apache, generally. 80, diff --git a/inventory/group_vars/proxies-stg b/inventory/group_vars/proxies-stg index edee986419..73799a7993 100644 --- a/inventory/group_vars/proxies-stg +++ b/inventory/group_vars/proxies-stg @@ -4,6 +4,11 @@ lvm_size: 30000 mem_size: 8192 num_cpus: 2 +# This is used in the httpd.conf to determine the value for serverlimit and +# maxrequestworkers. On 8gb proxies, 900 seems fine. But on 4gb proxies, this +# should be lowered in the host vars for that proxy. +maxrequestworkers: 900 + tcp_ports: [ # For apache, generally. 80, diff --git a/inventory/host_vars/proxy03.fedoraproject.org b/inventory/host_vars/proxy03.fedoraproject.org index f778675e95..e89fb372f6 100644 --- a/inventory/host_vars/proxy03.fedoraproject.org +++ b/inventory/host_vars/proxy03.fedoraproject.org @@ -18,3 +18,8 @@ postfix_group: vpn nrpe_procs_warn: 900 nrpe_procs_crit: 1000 + +# This is used in the httpd.conf to determine the value for serverlimit and +# maxrequestworkers. On 8gb proxies, 900 seems fine. But on 4gb proxies, this +# should be lowered in the host vars for that proxy. +maxrequestworkers: 400 diff --git a/roles/httpd/proxy/tasks/main.yml b/roles/httpd/proxy/tasks/main.yml index 15f37baf84..baeccc89e2 100644 --- a/roles/httpd/proxy/tasks/main.yml +++ b/roles/httpd/proxy/tasks/main.yml @@ -1,6 +1,6 @@ - name: Copy in the main httpd.conf file for proxy nodes - copy: > - src=httpd.conf dest=/etc/httpd/conf/httpd.conf + template: > + src=httpd.conf.j2 dest=/etc/httpd/conf/httpd.conf owner=root group=root mode=0644 notify: - restart httpd diff --git a/roles/httpd/proxy/files/httpd.conf b/roles/httpd/proxy/templates/httpd.conf.j2 similarity index 99% rename from roles/httpd/proxy/files/httpd.conf rename to roles/httpd/proxy/templates/httpd.conf.j2 index d753be1245..2d69004030 100644 --- a/roles/httpd/proxy/files/httpd.conf +++ b/roles/httpd/proxy/templates/httpd.conf.j2 @@ -108,8 +108,8 @@ KeepAliveTimeout 15 StartServers 150 MinSpareServers 50 MaxSpareServers 100 -ServerLimit 950 -MaxClients 900 +ServerLimit {{ maxrequestworkers }} +MaxRequestWorkers {{ maxrequestworkers }} MaxRequestsPerChild 10000 #