httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chandranshu ." <chandran...@gmail.com>
Subject [users@httpd] Re: httpd is creating large number of shared memory segments.
Date Fri, 26 Jun 2009 09:04:17 GMT
Hi

We changed our script that used to do a graceful restart to also record the
number of shared memory segments before and after the restart. Plotting the
number of shm segments vs. the number of times the server was restarted
gracefully was almost a straight line.

Even doing a `apachectl -k restart` didn't solve the problem. Rather, the
shared memory count again went up by 1.

Doing an `apachectl -k stop` removed all shared memory segments.

On starting it again using `apachectl -k start`, the server created 3 shared
memory segments, two of which had status as dest. However, repeatedly doing
ipcs -m -i <shmid> even on these shm segments showed that httpd and php-cgi
processes were attaching and detaching these segments as well.

So, is this the expected behavior of the server? And does the apache server
needs to be periodically stopped and started in case of multiple graceful
restarts?

Thanks for your kind consideration,
Chandranshu


On Thu, Jun 25, 2009 at 5:43 PM, Chandranshu . <chandranshu@gmail.com>wrote:

> Hi
>
> We're running http-2.2.3 with preform MPM and host around 500 sites for
> many users. We always do a graceful restart of the server lest some users
> lose their session. The server has created a large number of shared memory
> segments. We have seen it creating as many as 4030 segments and this number
> consistently stays above 1500.
>
> Doing ipcs -m shows that many of these segments have been marked for
> destruction but are still attached to some processes. Doing a grep on the
> pid of the process that last attached the segment returns nothing. Doing it
> in a while loop revealed that there were numerous httpd processes being
> spawned that attached the shm segment for a brief time before vanishing.
>
> Why are there so many shared memory segments and are they not freed up by
> the main process?Also, could someone please guide me as to why are the
> processes dying so fast and replaced by new processes? I guess it has
> something to do with the following config:
> <IfModule prefork.c>
>   StartServers      2
>   MinSpareServers   10
>   MaxSpareServers   25
>   ServerLimit     1024
>   MaxClients      1024
>   MaxRequestsPerChild  4000
> </IfModule>
>
> Thanks and regards
> Chandranshu
>

Mime
View raw message