i've got a problem with apache. When i try to start it (/etc/init.d/apache2 start) it dies after a few seconds. It shows up on "ps aux" consuming a lot of memory and then dies. I don't know what could be causing apache to consume this amount of memory:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 13379 1.0 0.3 14376 3908 ? Ss 22:31 0:00 /usr/sbin/apache2 -k start www-data 13383 0.0 0.4 197316 4196 ? Sl 22:31 0:00 /usr/sbin/apache2 -k start www-data 13390 0.0 0.3 172728 4172 ? Sl 22:31 0:00 /usr/sbin/apache2 -k start www-data 13396 0.0 0.3 156336 4160 ? Sl 22:31 0:00 /usr/sbin/apache2 -k start www-data 13400 0.0 0.3 148140 4156 ? Sl 22:31 0:00 /usr/sbin/apache2 -k start www-data 13403 0.0 0.3 131748 4148 ? Sl 22:31 0:00 /usr/sbin/apache2 -k start
Here is a htop screenshot:
http://i.stack.imgur.com/N4Chh.png
It happened suddenly, no change had been made to server config, so i don't know whats causing it. The error log of my virtual servers shows this:
[Sun Jan 30 22:19:50 2011] [alert] (11)Resource temporarily unavailable: mod_wsgi (pid=9685): Couldn't create worker thread 11 in daemon process 'fb.ebookmetafinder.com'. [Sun Jan 30 22:19:55 2011] [alert] (11)Resource temporarily unavailable: mod_wsgi (pid=9685): Couldn't create worker thread 19 in daemon process 'fb.ebookmetafinder.com'. [Sun Jan 30 22:29:40 2011] [alert] (11)Resource temporarily unavailable: mod_wsgi (pid=12009): Couldn't create worker thread 18 in daemon process 'fb.ebookmetafinder.com'. [Sun Jan 30 22:31:06 2011] [alert] (11)Resource temporarily unavailable: mod_wsgi (pid=13396): Couldn't create worker thread 15 in daemon process 'fb.ebookmetafinder.com'. [Sun Jan 30 22:35:02 2011] [alert] (11)Resource temporarily unavailable: mod_wsgi (pid=14009): Couldn't create worker thread 16 in daemon process 'fb.ebookmetafinder.com'. [Sun Jan 30 22:35:07 2011] [alert] (11)Resource temporarily unavailable: mod_wsgi (pid=14009): Couldn't create worker thread 17 in daemon process 'fb.ebookmetafinder.com'.
I'm on a ubuntu server vps and i use mod_wsgi with django.
Thanks.
EDIT: After editing Apache mpm configuration as sugested by alvosu apache starts correctly and don't crash but it consumes all the free ram of my system to the point of making it unstable:
root@vps:~# ps ps: error while loading shared libraries: libc.so.6: failed to map segment from shared object: Cannot allocate memory
This is the result of free -m with apache running:
total used free shared buffers cached Mem: 1024 1022 1 0 0 0 -/+ buffers/cache: 1022 1 Swap: 0 0 0
And this without it:
total used free shared buffers cached Mem: 1024 203 820 0 0 0 -/+ buffers/cache: 203 820 Swap: 0 0 0
I think apache shouldn't consume this amout of ram. I use apache to serve a dynamic pages and nginx for static one. I've got 4 virtual hosts on this server.