FastCGI 500 Internal Server error under moderate load on Solaris 10
Under moderate load, with a quickly responding external FastCGI handler around 5%
of requests get a 500 response. Under the same conditions the problem occurs on
Solaris 10 (sparc), but not Linux.
Investigation showed that the read in fcgi_demux_response was failing with EAGAIN -
although FIONREAD indicates data is waiting.
As for the proposed mod_proxy patch, the solution is basically to return 0 and try again on the next pass on each of the calls which can EAGAIN. There is a complication in that the chunkqueue_get_append_buffer needs to be rolled back / reused.
I'm attaching a patch to do this, although it would be less crude to use a function in chunk.h to free the latest chunk, or to make chunkqueue_get_append_buffer
return the same buffer again on the second call.
Also available in: Atom