By default in apache has set the Max_Connection =256, also if you want to raise your client limit like 512. Open the httpd.conf file and add the below lines,
# vim /etc/httpd/conf/httpd.conf
MaxClients 512
ServerLimit 512
Finally restart your httpd service.
If need to calculate the total active http connections, use this command,
# netstat -nap | grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2663/httpd
tcp 0 0 192.168.1.50:80 192.168.1.5:28225 SYN_RECV -
tcp 0 0 192.168.1.50:80 192.168.1.90:1916 SYN_RECV -
tcp 0 0 192.168.1.50:80 192.168.1.8:64631 SYN_RECV -
tcp 0 0 192.168.1.50:80 192.168.1.48:36603 SYN_RECV -
If you need to watch current running process every 2 seconds,
# watch "pgrep httpd"
Every 2.0s: pgrep httpd Thu Jul 30 12:31:11 2015
2656
2663
8096
8845
14616
16565
If you want to count the number of connection's
# pgrep httpd | wc -l
20
Number of request to your server,
# netstat -anp | grep 80| awk {'print $5'} | cut -d":" -f1 | sort | uniq -c | wc -l
Also get current connection with logs,
# tail -f /var/log/apache2/access.log
MySQL:
Also to know the MySQL database maximum connections in your system,
# mysqladmin -u root variables | grep max_connections
or
# mysqladmin -u root variables | grep max_connections | awk '{print $4}'
Comments (0)