User Tools

Site Tools


max_clients

Quick note: apache 2.4 - Max Clients is now named MaxRequestWorkers
You can find the apache values in:
/etc/httpd/conf/httpd.conf
OR
/etc/httpd/conf.modules.d/00-mpm.conf
If no value has been set then chances are the default of 256 is set. (Tip: run apache2buddy to find out the value if you are having trouble working it out)

CentOS

Best command to find the current apache processes is:

pstree | grep httpd
Alternative:
ps afx | grep httpd | wc


What is the number of max connection the server has been configured for?
grep -i maxclients /etc/httpd/conf/httpd.conf


When did apache hit max clients?

Centos

grep -i maxclients /var/log/httpd/error_log
Has it happened before? zgrep checks through ALL of the compresses and uncompressed logs, the * at the end of error represents all of the logrotated files:
zgrep -i maxclients /var/log/httpd/error_log*
What are the currently configured max connections?
grep -i maxc /etc/httpd/conf/httpd.conf | head -3
Ubuntu could have max clients configured in a number of different places, first place to look is:
grep -i maxc /etc/apache2/apache2.conf | head -4
or
grep -i maxc /etc/apache2/mods-enabled/mpm_prefork.conf
Current connections:
pstree | grep httpd

Ubuntu

grep -i maxclients /var/log/apache2/error_log
Has it happened before?
zgrep -i maxclients /var/log/apache2/error_log*
Current connections:
pstree | grep apache


CentOS

ps -H h -ylC httpd | perl -lane '$s+=$F[7];$i++;END{printf"Avg=%.1fMB\n",$s/$i/1024}'

Ubuntu

ps -H h -ylC apache2 | perl -lane '$s+=$F[7];$i++;END{printf"Avg=%.1fMB\n",$s/$i/1024}'

max_clients.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1