From 8cf9acd577a30bf9e6a54a9d82b9b7fc9ae769fb Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 16 Mar 2017 14:06:58 -0700 Subject: [PATCH] Tune apache connection limits down We are facing memory pressure in gate testing. Apache is fairly large so tune its connection limits down to try and squeeze out more useable memory. THis should be fine for dev envs, also tlsproxy is not enabled by default so we can check that this tuning works well on a subset of jobs before making it default everywhere. Data comparisons done with gate-tempest-dsvm-neutron-full-ubuntu-xenial jobs. Old: http://logs.openstack.org/37/447037/2/check/gate-tempest-dsvm-neutron-full-ubuntu-xenial/721fc6f/logs/screen-peakmem_tracker.txt.gz PID %MEM RSS PPID TIME NLWP WCHAN COMMAND 20504 0.2 16660 19589 00:00:00 34 - /usr/sbin/apache2 -k start 20505 0.2 16600 19589 00:00:00 34 - /usr/sbin/apache2 -k start 20672 0.2 16600 19589 00:00:00 34 - /usr/sbin/apache2 -k start 20503 0.1 14388 19589 00:00:00 34 - /usr/sbin/apache2 -k start 19589 0.1 9964 1 00:00:00 1 - /usr/sbin/apache2 -k start Total RSS: 74212 New: http://logs.openstack.org/41/446741/1/check/gate-tempest-dsvm-neutron-full-ubuntu-xenial/fa4d2e6/logs/screen-peakmem_tracker.txt.gz PID %MEM RSS PPID TIME NLWP WCHAN COMMAND 8036 0.1 15316 8018 00:00:01 34 - /usr/sbin/apache2 -k start 8037 0.1 15228 8018 00:00:01 34 - /usr/sbin/apache2 -k start 8018 0.1 8584 1 00:00:00 1 - /usr/sbin/apache2 -k start Total RSS: 39128 Note RSS here is in KB. Total difference is 35084KB or about 34MB. Not the biggest change, but we seem to be functional and it almost halves the apache overhead. Change-Id: If82fa347db140021197a215113df4ce38fb4fd17 --- lib/tls | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/tls b/lib/tls index f9ef554a6c..fb2fa3a17b 100644 --- a/lib/tls +++ b/lib/tls @@ -457,29 +457,30 @@ function tune_apache_connections { # MaxClients: maximum number of simultaneous client connections # MaxRequestsPerChild: maximum number of requests a server process serves # -# The apache defaults are too conservative if we want reliable tempest -# testing. Bump these values up from ~400 max clients to 1024 max clients. +# We want to be memory thrifty so tune down apache to allow 256 total +# connections. This should still be plenty for a dev env yet lighter than +# apache defaults. # Note that the next three conf values must be changed together. # MaxClients = ServerLimit * ThreadsPerChild -ServerLimit 32 +ServerLimit 8 ThreadsPerChild 32 -MaxClients 1024 -StartServers 3 -MinSpareThreads 96 -MaxSpareThreads 192 +MaxClients 256 +StartServers 2 +MinSpareThreads 32 +MaxSpareThreads 96 ThreadLimit 64 MaxRequestsPerChild 0 # Note that the next three conf values must be changed together. # MaxClients = ServerLimit * ThreadsPerChild -ServerLimit 32 +ServerLimit 8 ThreadsPerChild 32 -MaxClients 1024 -StartServers 3 -MinSpareThreads 96 -MaxSpareThreads 192 +MaxClients 256 +StartServers 2 +MinSpareThreads 32 +MaxSpareThreads 96 ThreadLimit 64 MaxRequestsPerChild 0