Ticket #1488 (new defect)
PHP does not use FCGI_OVERLOADED, suggest to use timeout to detect overload
| Reported by: | oliver@… | Owned by: | jan |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.5.0 |
| Component: | mod_fastcgi | Version: | 1.4.18 |
| Severity: | normal | Keywords: | |
| Cc: | Blocked By: | ||
| Need User Feedback: | no | Blocking: |
Description
as stated here:
http://bugs.php.net/bug.php?id=39809
"PHP cannot return FCGI_OVERLOADED". so the fastcgi connection just times out during heavy overloading. Right now lighty's mod_fastcgi gets stuck in PROC_STATE_DIED_WAIT_FOR_PID. but of course the php parent never dies, because it is not shutting down, just very busy.
i have attached a proposed patch idea which shows how to interpret a PROC_STATE_DIED_WAIT_FOR_PID the same as PROC_STATE_OVERLOADED. (just a simple code copy).
For this to become a proper solution it would have to be triggered by a mod_fastcgi config, eg:
"treat-timeout-as-overload" = 1
which would be set for PHP configs when running with bin-path set (ie for local php processes which are the children of lighty).
There is a workaround, which is to use spawn_fcgi to launch php and use lighty config without bin-path. In this case, because lighty has no other choice, it just waits 5 seconds in case of timeout and tries again to send more requests. This behaviour is of course better given PHP's slight misbehaviour in not sending FCGI_OVERLOADED.
see also http://bugs.php.net/bug.php?id=43610 where I am re-asking whether is would be possible for PHP to adhere to the fastcgi more stringently with regard to FCGI_OVERLOADED.

