You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marten Lehmann <le...@cnm.de> on 2008/01/28 15:09:42 UTC
Huge httpd-process
Hello,
using "top", I noticed this output:
top - 08:48:40 up 24 days, 17:21, 1 user, load average: 173.78, 113.81,
52.58
Tasks: 449 total, 47 running, 397 sleeping, 0 stopped, 5 zombie
Cpu(s): 5.2% us, 56.6% sy, 0.4% ni, 0.0% id, 37.5% wa, 0.0% hi, 0.2% si
Mem: 2056328k total, 2038468k used, 17860k free, 3216k buffers
Swap: 2040244k total, 2040244k used, 0k free, 29344k cached
PID USER PR NI %CPU TIME+ %MEM VIRT RES SHR S COMMAND
68 root 16 0 49 16:59.70 0.0 0 0 0 R kswapd0
17689 nobody 16 0 12 1:00.98 65.2 3665m 1.3g 1832 D httpd
21497 u11754 16 0 4 0:00.16 0.4 63240 8072 4604 D php
21064 u12732 16 0 3 0:00.30 0.5 109m 9628 4652 D php
18761 nobody 16 0 3 0:00.36 0.1 38808 2124 1632 S httpd
21068 u12072 18 0 3 0:00.31 0.8 72212 16m 4616 R php
21093 nobody 16 0 3 0:00.12 0.1 38612 1940 1444 S httpd
In our configuration, httpd runs as user nobody to deliver static
content. We have SSL and non-SSL hosts (mostly). As soon as perl or php
scripts are started, a cgiwrapper is being used, so the processes
have a different user id and another command name (php in this case).
So I'm really wondering, why there is a httpd process which uses 65% of
the memory. As you can see in the load average line, the process is
getting even greater. This occurs every now and then. And there are
following effects of this:
- swapd is used to get more memory which slows down the system
- sometimes the httpd-process us killed automatically (or at least
disappears at some point and the system goes back to usual load, or:
- httpd-process is consistently consuming more and more memory, even
swapd can't help, the whole system crashes.
Within our cgiwrapper, we have memory limits, But since this all is
happens within apache, we cannot set any limits.
We are currently using httpd-2.2.4. Hoe comes, that httpd processes can
get that huge?
Regards
Marten
Re: Huge httpd-process
Posted by Rainer Jung <ra...@kippdata.de>.
Hi Marten,
Marten Lehmann schrieb:
> Hello,
>
>> If you think this is a bug, please open a bug in bugzilla. Adding you
>> configuration
>> to the bug could be also helpful.
>
> in the meantime I have upgraded to 2.2.8, but I still sometimes see
> processes like this:
>
> 2069 nobody 15 0 1 0:46.23 87.6 2460m 1.7g 1564 D httpd
>
> httpd is consuming 87% of the ram. Why does he do that? How can I trace
> what the process is doing? I guess it is useless to post bug report
> without additional information.
This is likely not the answer you are looking for, but: if you think it
might be a leak, i.e. the amount of memory is slowly growing over
time/requests, you could use MaxRequestsPerChild. It will tell httpd to
end child processes after that many requests (more precisely
connections). httpd will automatically start new children if needed.
Don't set it to extremely small values though, because forking a lot of
processes (like 10 per second or even more) will be very inefficient.
How small is extremely small? You'll have to do some calculations about
how many requests per second a single httpd process is doing for you.
Concerning "what is using memory": anything interesting in
/proc/2069/maps ? It might be simply showing, that it's heap, but one
never knows ;)
Regards,
Rainer
Re: Huge httpd-process
Posted by Marten Lehmann <le...@cnm.de>.
Hello,
> If you think this is a bug, please open a bug in bugzilla. Adding you configuration
> to the bug could be also helpful.
in the meantime I have upgraded to 2.2.8, but I still sometimes see
processes like this:
2069 nobody 15 0 1 0:46.23 87.6 2460m 1.7g 1564 D httpd
httpd is consuming 87% of the ram. Why does he do that? How can I trace
what the process is doing? I guess it is useless to post bug report
without additional information.
>> consume that much memory (we are not using mod_php, mod_perl or anything
>> like that).
>
> Do you use any other third party modules?
I'm using a self-programmed module for dynamic mapping from hostnames to
document-roots from a berkeley db. But it is read only. The same
configuration is running on different servers, but only one with a high
load seems to cause this problem.
Regards
Marten
Re: Huge httpd-process
Posted by Ruediger Pluem <rp...@apache.org>.
On 01/28/2008 04:26 PM, Marten Lehmann wrote:
> Hello,
>
>>> We are currently using httpd-2.2.4. Hoe comes, that httpd processes
>>> can get that huge?
>>
>> Martin, may I recommend that you send such support questions to one of
>> the
>> our user mailing lists instead of the developer list.
>>
>> http://httpd.apache.org/userslist.html (English)
>> http://httpd.apache.org/usersdelist.html (German)
>
> I was doing so, but noone has answered. And the request us very
> technical and not a configuration issue, so I don't think that common
> users may help me. Maybe it is a bug since httpd processes should never
If you think this is a bug, please open a bug in bugzilla. Adding you configuration
to the bug could be also helpful.
> consume that much memory (we are not using mod_php, mod_perl or anything
> like that).
Do you use any other third party modules?
Regards
RĂ¼diger
Re: Huge httpd-process
Posted by Marten Lehmann <le...@cnm.de>.
Hello,
>> We are currently using httpd-2.2.4. Hoe comes, that httpd processes can
>> get that huge?
>
> Martin, may I recommend that you send such support questions to one of the
> our user mailing lists instead of the developer list.
>
> http://httpd.apache.org/userslist.html (English)
> http://httpd.apache.org/usersdelist.html (German)
I was doing so, but noone has answered. And the request us very
technical and not a configuration issue, so I don't think that common
users may help me. Maybe it is a bug since httpd processes should never
consume that much memory (we are not using mod_php, mod_perl or anything
like that).
Regards
Marten
Re: Huge httpd-process
Posted by Lars Eilebrecht <la...@apache.org>.
Marten Lehmann wrote:
> We are currently using httpd-2.2.4. Hoe comes, that httpd processes can
> get that huge?
Martin, may I recommend that you send such support questions to one of the
our user mailing lists instead of the developer list.
http://httpd.apache.org/userslist.html (English)
http://httpd.apache.org/usersdelist.html (German)
Best Regards
--
Lars Eilebrecht
lars@apache.org