test
[hcoop/zz_old/ikiwiki] / DaemonAdmin / Apache.mdwn
CommitLineData
ee25310d 1\r
2This page describes how to deal with Apache issues. It is intended for use by HCoop administrators.\r
3\r
4[[TableOfContents]]\r
5\r
6== Dealing with too many apache processes ==\r
7\r
8Sometimes on our old machines (fyodor), too many apache processes are run, and they consume all available memory. In case this same problem is ever experienced on the new machines, it could be handy to know how to do this recovery procedure.\r
9\r
10This problem can be diagnosed by running\r
11\r
12{{{\r
13free\r
14}}}\r
15\r
16to check the amount of memory being used, and\r
17\r
18{{{\r
19ps -e | grep [a]pache2 | wc -l\r
20}}}\r
21\r
22to see how many Apache processes are running. If there are around 100 processes or more running, and we have less than 60MB memory free, and are using more than 50% of swap, we need to continue with the "apache2 draining" procedure listed below.\r
23\r
24To get rid of apache2 processes, do the following.\r
25\r
26{{{\r
27iptables -I INPUT 1 --proto tcp --dport 80 -j REJECT\r
28/etc/init.d/apache2 stop # wait about 5 minutes, then hit Ctrl+c a few times to stop\r
29killall apache2\r
30killall -9 apache2\r
31/etc/init.d/apache2 start\r
32iptables -D INPUT 1\r
33}}}\r
34\r
35Now check to see whether member websites can be browsed. Also, check to see whether the amount of free memory has increased substantially.\r