concurrent connections and multiple accepts
Barclay Curtis <barclay.curtis-oQjRbAq6OkS2oZ/[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi My first post, am a bit of a newbie to FCGI. Bear with me, this a bit long. But its just background, and describing symptoms of the problem. :) THE BACKGROUND: I have a fastcgi external server set-up and (kinda) working. It was written by a former employee, but not entirely finished. I've taken over development. We run an 'appserver' which is written in perl and basically fork some children and manages them. Each child is a FCGI application, which does $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, $socket, 0) and then loops on $request->Accept in the same way all the FCGI examples do. Each child uses the same socket. THE PROBLEM: The problem is (i think) that FCGI cannot accept concurrent connections. So if the appserver forks one child and a user requests a page that takes a long time to load, then the next page request has to wait it to finish. If the appserver forks 2 children, and the same situation occurs then one child handles each request. So the normal page request is handled without having to wait for the long one to finish. Which is good. But.... I open a window with 17 tabs, each requesting a different page from the site. With 2 children forked: I do a refresh all tabs, and 9/10 times at least one page will get an error 500. The error in log is: FastCGI: incomplete headers (0 bytes) received from server When i get this error it doesn't appear to have made any connection with my FCGI appserver child (would get debuggin info warned to the log when the Accept is successful). With only one child this does not happen. THE QUESTIONS: Does this make any sense? Are the error something todo with the 2 children both calling accept? If I were to have only one child, is there a way around it making other request wait? Any help appreciated Thanks Barclay -- Barclay Curtis Senior Developer Nexus Media Communications Ltd Media House, Azalea Drive, Swanley, Kent BR8 8HY _____________________________________________ +44 (0) 1322 611460 www.nexusmedia.co.uk ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/