2

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!

3
  • 1
    If you're running around 500 connections, you're probably hitting your MaxClients 400 configuration. What's the behavior of the Apache server when the crash occurs? HTTP errors to clients, or "connection refused"? Anything in Apache's error log? Mar 15, 2012 at 17:31
  • Did you already remove the unused modules?
    – ghm1014
    Mar 15, 2012 at 22:09
  • Your other possibility is DoS attacks, have you implemented defence against the PHP hash table collisions? and SlowLoris Apache connection blocking?
    – Oneiroi
    Mar 16, 2012 at 9:30

4 Answers 4

2

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.

1

Nothing in your configuration should ever cause Apache to crash. Unless you are running out of memory, you should look somewhere else for the cause of the problem.

1

you should start by graphing the utilization of your ressources (eg load, memory, swap..) so you get a picture of what's actually happening.

Take a look at the system and apache logs and see if there are some "abnormal" messages right before the crash.

From your config excerpt i guess you are using the worker mpm, it looks rather normal, this config alone will not lead to a crash on it's own.

0

Are you running any scripting language, PHP maybe?

Background of my question is that I had something similar on one server running Apache and PHP. At the end of the day it hasn't been Apache killing the server, but PHP running into OOM killing virtually vital processes and THAT killed the server (for me).

Check my answer in this thread for a OOM workaround. Maybe check your server log files for OOM entries as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .