A server I was recently working on kept crashing because it was getting too many connections. This is normally a sign of popularity, but when it prevents people from being able to access your product that’s not a good thing. The first step in handling an issue like this is monitoring it in real-time so that you can see what causes it and know when it’s time to restart apache. The default setting is 256, so when you’re getting close to that number, be aware.
Use this command at the terminal to get the current number of open connections:
pgrep httpd | wc -l
And if you want to monitor it in real time, watch it:
watch “pgrep httpd | wc -l”
Note that the best approach is to configure apache to provide server-status so that you can pull up all connections in a browser window, but that requires editing httpd.conf and restarting, and should be the topic of a whole other post.
Hope that helps!
Leave a Reply