Linux – Server crashing: Too many connections

apache-2.2debianlinux

I have server with approximately 500 active connections at a time (it's for a very busy website). Unfortunately, Apache keeps crashing the entire server every hour or so. The server has 8 GB of RAM and a quad core Xeon CPU so, as far as I am concerned, this should be sufficient to handle the amount of connections. I suspect that my Apache configuration could need some optimization. Here is the current config:

StartServers          2
MinSpareThreads      25
MaxSpareThreads      75 
ThreadLimit          64
ThreadsPerChild      25
MaxClients           400
MaxRequestsPerChild  20000

Any advice (not only related to Apache) is MUCH appreciated!

Best Answer

Is your machine crashing or the Apache server?

If the first, then I would consider it might be faulty hardware (memory).

If it's the second, try to use some monitoring tools like munin to see what happens at what time intervals and what the load/stress on your server is. Also check your error logs to get more clues what's happening.

Related Topic