Re: Threaded fastcgi-server - truncated output
David Birnbaum <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel,gmane.spam.detected |
|---|---|
| Message-ID | <[email protected]> |
Vladimir, There is a buffering going on in the FastCGI library between the application and the server. It sounds like something is either interacting with that, or with something else. I don't think any of our perl code (using CGI::Fast) shows a sleep going on, but it's also not threaded. Any lower-level developers out there who can comment on this? Sounds like either a code patch, documentation patch, or both might be due. David. ----- On Sat, 13 Oct 2007, Vladimir V. Pavluk wrote: > Hello! > > Playing with my code making it similar to the example I figured out that the > problem appears when I'm setting the O_NONBLOCK flag on the socket which I > listen to. > Is it a bug, or it is a documented behaviour? > > Sincerely, Vladimir V.Pavluk. > >> Hello! >> >> I've wrote the threaded fastcgi application, which is generally works fine. >> However, I've found a problem: when the size of output becomes more than >> some threshold (in my case - about 8.7 kb), the rest output is truncated. >> It seemed to me that the stream does not have time to be flushed before the >> FCGX_Finish_r is called, because when I insert sleep(1) line, the problem >> is gone. >> I've found an example of threaded fastcgi server in dev kit distribution, >> and found the 'sleep(2)' line just after output. >> So, I have following questions: >> Is this delay really needed for allowing streams to be flushed? >> How can we do it without sleep delays (if it is possible at all) - I don't >> really want to insert sleeps after output as it looks as a dirty hack :( >> ?.. >> >> Sincerely, Vladimir V. Pavluk. >> ___________________________________ >> fastcgi-developers mailing list >> http://fastcgi.com/fastcgi-developers/ > > > ___________________________________ > fastcgi-developers mailing list > http://fastcgi.com/fastcgi-developers/ > ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/