Apache too graceful?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi all,

(this is a PHP question...honest!)

I'm getting a lot of httpds hanging around in status G for a v. long time
(apache 1.3.27) what concerns me is that they all seem to have just run the
same script...one which does things a little strangely.

It (proxy.php) proxies a request to another script on the site (process.php)
by opening a socket, and sending an HTTP request down it, then reading back
the response....up to a point. The other script takes a long time to run -
approx 30 seconds, but is able to tell the proxy whether it will succeed
after approx 2 seconds. When 'proxy.php' receives this notification from
'process.php' it closes the socket, and exits. Since 'process.php' ignores
user abort, it keeps running until completed.

So despite the fact that PHP has exited, the client has disconnected, the
httpd process which ran proxy.php is still in status G.

Anybody any clues why? I couldn't find anything useful on apache.org. Google
just turns up thousands of server-status pages and pages about mod_status.



Re: Apache too graceful?

If you're trapping signals in process.php, are you sure it's really
closing?  Does netstat show a lot of stuff in close_wait or some
similar state?

Re: Apache too graceful?

Matt wrote:

Quoted text here. Click to load it

Not a significant amount. It's running the register_shutdown_function within
PHP, then logging the request in the access_log, which rather suggests it's
trying to finish.


Site Timeline