| Author |
Message |
mondalaci
Joined: 02 Mar 2010
Posts: 2
|
| Posted: Sat Jan 21, 2012 7:06 am Post subject: 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 |
|
| Back to top |
|
glg
Joined: 09 Jan 2009
Posts: 505
|
| Posted: Sat Jan 21, 2012 10:27 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
Vance
Joined: 18 Jan 2009
Posts: 355
|
| Posted: Sat Jan 21, 2012 8:50 pm Post subject: |
|
|
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. |
|
| Back to top |
|
mondalaci
Joined: 02 Mar 2010
Posts: 2
|
| Posted: Tue Jan 24, 2012 12:59 pm Post subject: |
|
|
@gig:
root@linode:/etc/apache2# apache2ctl -l
Compiled in modules:
core.c
mod_log_config.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:
<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 3
MaxSpareServers 6
MaxClients 5
ServerLimit 5
MaxRequestsPerChild 300
</IfModule>
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. |
|
| Back to top |
|
| |