Apache outages that I don't understand

Hi guys,

On about a daily basis my LAMP site goes down for some minutes. This keeps happening for a long time but I've never looked into it deeply enough until now.

Currently multiple site monitoring services are set up for http://monda.hu and I get alerts on a daily basis. There's another Linode in the same datacenter from which I curl http://monda.hu/ on a per minute basis to see for myself whether it's alive. These curl logs confirm the alerts of the site monitoring services that are set up.

Also, on monda.hu I run a script containing:

(free; ps_mem.py; ping -c 1 google.com) > date +%Y-%m-%d_%H:%M.log

on a per-minute basis to be able to see whether there's any network connectivity issues or whether trashing may happen.

The problem is that I cannot see anything that'd explain why this keeps happening. I'm suspicious regarding trashing but cannot see any sign of it. In the Linode Manager there are no spikes and according ps_mem.py (which is a ps-like smaps based tool) I should have enough free memory (memory usage seem to be always below 300MiB of about 435).

What could be the cause then?

Thanks in advance.

Laci

3 Replies

Are you using prefork in apache and is your MaxClients set at the default? This is the cause of like 90% of the OOM errors people have here.

Is there any pattern to the time of day that problems occur? If so, it could be a CPU- or I/O-hungry cron job interfering with the web server.

I don't know what statistics ps_mem.py collects. If it doesn't track CPU usage, then adding vmstat 1 2 to your monda.hu script may be helpful. The first line of data will represent system activity since the last reboot, and the next line will be activity for the current second.

@gig:

root@linode:/etc/apache2# apache2ctl -l

Compiled in modules:

core.c

modlogconfig.c

mod_logio.c

prefork.c

http_core.c

mod_so.c

This suggests me that I'm using the prefork MPM module.

As for the MaxClients and related settings:

StartServers 1

MinSpareServers 3

MaxSpareServers 6

MaxClients 5

ServerLimit 5

MaxRequestsPerChild 300

I've been experimenting with various values a while ago and this produced the best results.

@Vance:

Generally these problems occur once or twice per day but I couldn't observe any specific patterns. I don't think that it's a cronjob because I could see that in the output of ps_mem.py

I've just added vmstat 1 2 to my script, thanks for the suggestion.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct