You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Chandranshu ." <ch...@gmail.com> on 2009/07/28 13:36:59 UTC

[users@httpd] Long running Apache 2.2 process

Hi

We are running Apache 2.2 and have setup PHP-CGI to serve PHP files. Today,
we observed that a php-cgi process has been running for a very long time and
is consuming 100% CPU. The parent apache process of this php-cgi has been
running since July 26th. We do a graceful restart of the server every hour
to pick up new virtual host connections but apparently, this process has not
been reaped till now.

Is there a way to figure out what request this apache process is serving?

I have tried looking up on Google and found apachetop but that doesn't give
us the required information.

I have also tried to locate the file being executed with 'lsof -p <pid of
apache and php-cgi prcoess>' but that listed mostly the dynamic libraries.
The peculiar entries in the php-cgi case were:

php-cgi 16665 swarLD21606    0r  FIFO    0,6           2605128
pipe
php-cgi 16665 swarLD21606    1w  FIFO    0,6           2605129
pipe
php-cgi 16665 swarLD21606    2w  FIFO    0,6           2605130
pipe
php-cgi 16665 swarLD21606    3u  sock    0,5           2605937 can't
identify protocol

and in the case of httpd was:
httpd   16414 apache  558u  sock    0,5            2605127 can't identify
protocol

which we haven't been able to explain.

Any suggestions to investigate will also be very helpful.

Thanks and regards
Chandranshu

[users@httpd] Re: Long running Apache 2.2 process

Posted by "Chandranshu ." <ch...@gmail.com>.
I opened GDB and attached the php-cgi process. We were able to determine the
the PHP script it was executing. After that, inspecting the source code of
the PHP file gave out all the reasons why it was running for so long.

The question now is different. I want to understand the circumstances under
which a forked apache process will continue to run even when the root apache
process has died off.

Regards
Chandranshu

On Tue, Jul 28, 2009 at 6:54 PM, Chandranshu . <ch...@gmail.com>wrote:

> Hi
>
> We have now turned on mod_status and added the "ExtendedStatus On"
> directive to httpd.conf and have restarted apache gracefully. However, there
> is no information about the rogue process. I guess this is because that
> process was forked before this directive was turned on.
>
> Anything else we can try to track the request being served by that process?
>
> Thanks and regards
> Chandranshu
>
>
> On Tue, Jul 28, 2009 at 5:06 PM, Chandranshu . <ch...@gmail.com>wrote:
>
>> Hi
>>
>> We are running Apache 2.2 and have setup PHP-CGI to serve PHP files.
>> Today, we observed that a php-cgi process has been running for a very long
>> time and is consuming 100% CPU. The parent apache process of this php-cgi
>> has been running since July 26th. We do a graceful restart of the server
>> every hour to pick up new virtual host connections but apparently, this
>> process has not been reaped till now.
>>
>> Is there a way to figure out what request this apache process is serving?
>>
>> I have tried looking up on Google and found apachetop but that doesn't
>> give us the required information.
>>
>> I have also tried to locate the file being executed with 'lsof -p <pid of
>> apache and php-cgi prcoess>' but that listed mostly the dynamic libraries.
>> The peculiar entries in the php-cgi case were:
>>
>> php-cgi 16665 swarLD21606    0r  FIFO    0,6           2605128
>> pipe
>> php-cgi 16665 swarLD21606    1w  FIFO    0,6           2605129
>> pipe
>> php-cgi 16665 swarLD21606    2w  FIFO    0,6           2605130
>> pipe
>> php-cgi 16665 swarLD21606    3u  sock    0,5           2605937 can't
>> identify protocol
>>
>> and in the case of httpd was:
>> httpd   16414 apache  558u  sock    0,5            2605127 can't identify
>> protocol
>>
>> which we haven't been able to explain.
>>
>> Any suggestions to investigate will also be very helpful.
>>
>> Thanks and regards
>> Chandranshu
>>
>
>

[users@httpd] Re: Long running Apache 2.2 process

Posted by "Chandranshu ." <ch...@gmail.com>.
Hi

We have now turned on mod_status and added the "ExtendedStatus On" directive
to httpd.conf and have restarted apache gracefully. However, there is no
information about the rogue process. I guess this is because that process
was forked before this directive was turned on.

Anything else we can try to track the request being served by that process?

Thanks and regards
Chandranshu

On Tue, Jul 28, 2009 at 5:06 PM, Chandranshu . <ch...@gmail.com>wrote:

> Hi
>
> We are running Apache 2.2 and have setup PHP-CGI to serve PHP files. Today,
> we observed that a php-cgi process has been running for a very long time and
> is consuming 100% CPU. The parent apache process of this php-cgi has been
> running since July 26th. We do a graceful restart of the server every hour
> to pick up new virtual host connections but apparently, this process has not
> been reaped till now.
>
> Is there a way to figure out what request this apache process is serving?
>
> I have tried looking up on Google and found apachetop but that doesn't give
> us the required information.
>
> I have also tried to locate the file being executed with 'lsof -p <pid of
> apache and php-cgi prcoess>' but that listed mostly the dynamic libraries.
> The peculiar entries in the php-cgi case were:
>
> php-cgi 16665 swarLD21606    0r  FIFO    0,6           2605128
> pipe
> php-cgi 16665 swarLD21606    1w  FIFO    0,6           2605129
> pipe
> php-cgi 16665 swarLD21606    2w  FIFO    0,6           2605130
> pipe
> php-cgi 16665 swarLD21606    3u  sock    0,5           2605937 can't
> identify protocol
>
> and in the case of httpd was:
> httpd   16414 apache  558u  sock    0,5            2605127 can't identify
> protocol
>
> which we haven't been able to explain.
>
> Any suggestions to investigate will also be very helpful.
>
> Thanks and regards
> Chandranshu
>