Edward Kay wrote:
Hello,
I need PHP's IMAP extension for my web app but it is really slowing my
server up.
My setup: Fedora Core 5, Apache 2.2.2, PHP 5.1.4 (run as CGI with suPHP),
PHP IMAP extension - all standard FC5 RPMs. The test page is simple - just a
call to phpinfo().
Without the IMAP extension, the response time is almost immediate. With the
IMAP extension it takes 2-3 seconds to respond - sometimes as much as 4
secs.
Watching with 'top', I can see php-cgi is called immediately when the
request is received. With the IMAP extension installed, after php-cgi
starts, it then drops to the end of the 'top' list, consuming 0% CPU and
2.0% memory. It remains there for the 2-3 second delay before coming into
play again an running the script quickly. Without the IMAP extension, it
just ends quickly having finished the request.
From this, it is clear to me there is some major delay being introduced by
the loading of the IMAP extension. Any ideas on how to resolve this?
If you don't have to, don't run it as a cgi.
A /possible/ solution, and I don't even know if it's possible, is to
compile two versions of the cgi; one with and one without. While I know
that part is at least possible, I don't know if you can make your
webserver *choose* which version of the cgi to run depending on the need.
Can the cgi in PHP5 dynamically load modules? dl() is available in
PHP4, but I think they got rid of it in PHP5
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel@xxxxxxxxxxxxxxxxxxxxxxxxxxx
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php