Accept() loop in php-fcgi?
Jonathan Chen <ccchen-z0t8KZiULAH2/[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Recently I moved some of my php scripts from running on mod_php to
(mod_fastcgi + php-fcgi) under Apache; hoping to see some gains on
performance, however, I observed that having (mod_fastcgi + php-fcgi)
brings almost no benefit. On the other hand, the equivalent perl
script runs 10x faster on (mod_fastcgi + perl).
On perl, I convert a script like:
#!/usr/bin/perl
use XXX; # heavy initialization stuff
print(“Content-type: text/html\n\n”); # start of response
print(“Serving request...”);
to fastcgi script like:
#!/usr/bin/perl
use FCGI;
use XXX; # heavy initialization stuff
while(FCGI::accept() >= 0) {
print(“Content-type: text/html\n\n”); # start of response
print(“Serving request...”);
}
I am wondering if there is a notion of FCGI::accept() loop in php
semantics? It seems like php-fcgi implements the accept() outside of
the php scripts, which makes me unable to seperate the heavy
initialization part from the response part.
Any ideas?
Thanks,
Jonathan
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/