[SlugBug] Apache memory usage problem

Bill Best bill.best at commedia.org.uk
Tue Dec 6 20:34:02 GMT 2005


hi

my installation of Apache has recently started to lock up and cause the 
following problem:

> Dec  5 16:18:25 xxxx kernel: Out of Memory: Killed process 30482 (httpd).
> Dec  5 16:19:18 xxxx kernel: Out of Memory: Killed process 29956 (httpd). 

there is an Apache memory usage problem - here's top:

> top - 20:22:03 up 1 day,  3:51,  1 user,  load average: 0.24, 0.13, 0.04
> Tasks:  74 total,   1 running,  73 sleeping,   0 stopped,   0 zombie
> Cpu(s):  0.7% us,  0.7% sy,  0.0% ni, 47.0% id, 51.5% wa,  0.0% hi,  0.2% si
> Mem:   2076004k total,  2068060k used,     7944k free,     4628k buffers
> Swap:  2096440k total,  2096440k used,        0k free,   286796k cached
> 
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
>  5942 apache    15   0  312m 252m  17m S  0.0 12.4   0:30.97 httpd
>  3518 apache    15   0  468m 164m  17m S  0.0  8.1   1:08.03 httpd
>  3524 apache    15   0  406m 132m  17m S  0.0  6.5   1:12.67 httpd
>  5946 apache    16   0  247m 127m  17m S  0.0  6.3   0:26.75 httpd
>  5921 apache    15   0  180m 121m  17m S  0.0  6.0   0:26.41 httpd
>  3852 apache    15   0  251m 121m  17m S  0.0  6.0   1:10.67 httpd
>  3522 apache    15   0  568m 118m  92m D  2.0  5.8   1:14.50 httpd
>  3523 apache    15   0  316m 118m  17m S  0.0  5.8   1:08.46 httpd
>  3521 apache    15   0  356m 113m  17m S  0.0  5.6   1:11.17 httpd
>  3854 apache    15   0  232m  95m  17m S  0.0  4.7   1:07.45 httpd
>  3517 apache    15   0  178m  69m  17m S  0.0  3.4   1:11.53 httpd
>  5943 apache    15   0 90548  65m  17m S  0.0  3.2   0:27.46 httpd
>  3864 apache    15   0  255m  64m  17m S  0.0  3.2   1:09.34 httpd
>  5904 apache    15   0 98.0m  61m  17m S  0.0  3.0   0:37.40 httpd
>  5906 apache    15   0 97.8m  55m  17m S  0.0  2.8   0:27.87 httpd
>  8066 apache    15   0 30548  12m  17m S  0.0  0.6   0:00.66 httpd

when i restart Apache it frees the memory used:

> top - 20:28:34 up 1 day,  3:58,  1 user,  load average: 0.18, 0.15, 0.09
> Tasks:  66 total,   1 running,  65 sleeping,   0 stopped,   0 zombie
> Cpu(s):  0.0% us,  0.0% sy,  0.0% ni, 99.2% id,  0.6% wa,  0.0% hi,  0.2% si
> Mem:   2076004k total,   332764k used,  1743240k free,     3648k buffers
> Swap:  2096440k total,    13088k used,  2083352k free,   273496k cached
> 
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
>  8183 apache    15   0 29116  17m  17m S  0.0  0.9   0:00.16 httpd
>  8184 apache    15   0 25936  14m  17m S  0.0  0.7   0:00.04 httpd
>  8185 apache    16   0 23416  11m  17m S  0.0  0.6   0:00.03 httpd
>  8186 apache    15   0 21608 9900  17m S  0.0  0.5   0:00.00 httpd
>  8187 apache    16   0 21608 9788  17m S  0.0  0.5   0:00.00 httpd
>  8188 apache    24   0 21608 9788  17m S  0.0  0.5   0:00.00 httpd
>  8189 apache    24   0 21608 9788  17m S  0.0  0.5   0:00.00 httpd
>  8190 apache    24   0 21608 9788  17m S  0.0  0.5   0:00.00 httpd
>  8180 root      16   0 21608 9764  17m S  0.0  0.5   0:00.45 httpd
>  1369 mysql     16   0 35848 9008 5608 S  0.0  0.4   0:00.36 mysqld

any clues as to what might be going wrong?

this reference here points to a "bad rewrite rule":

http://kimihia.org.nz/articles/apachemem/

my questions are:

i) is the above good advice?
ii) why doesn't/cannot apache release the memory it uses?
iii) how might i best identify which rewrite rule is bad?
iv) any other advice?

many thanks in advance for your help

bill


More information about the SlugBug mailing list