Difference in page generation time PHP 5.4 + APC in php-fpm and fastcgi mode

Status
Not open for further replies.

Magician

Verified User
Joined
Jan 31, 2010
Messages
135
Location
EU / PL
Hi,

I tested 2 configurations: php-fpm and fastcgi. When use fastcgi my test page first response from server is approximately 0,12-0,14 sec (after few refresh). When set php-fpm and compile apache and php response time is aprox. 0,25-0,30 sec. (after few refresh)
In both config I use PHP 5.4.17, APC and same php.ini.
My test system are on OpenVZ, Debian 6. I test in different time to exclude possibly OpenVZ host overload. The result are practically the same.

Is any particular reason for this difference? It's normal? Or I should in some way optimize php-fpm config? (change daemon from ondemand to dynamic, as I expect change nothing).

I want to use php-fpm but difference in speed make me doubts...

Thank you for any suggestion.
 
@zEitEr - thank you for your info
Now I'm not sure what way choose. I want speed... Is any reason to use php-fpm instead fastcgi? If anyone has servers with many users can share their experience with usage php-fpm or fastcgi and page generation time?
 
I'd try php-fpm, at least with NGINX it is quite stable (I've been using it with nginx for several years till now).
 
@zEitEr - thank you for your info
Now I'm not sure what way choose. I want speed... Is any reason to use php-fpm instead fastcgi? If anyone has servers with many users can share their experience with usage php-fpm or fastcgi and page generation time?

PHP-FPM will use less memory in combination with APC because all child use the same APC instance.
FastCGI will use more memory because it needs an instance per thread AFAIK:
http://stackoverflow.com/questions/...eral-php-processes-when-running-under-fastcgi

Also FastCGI doesn't support HTTP_Auth: https://github.com/symfony/symfony/issues/1813
 
Last edited:
I found reason... PHP-FPM config set open_basedir instead FastCGI. When remove open_basedir generation time is ok in PHP-FPM. Topic to close.
 
Status
Not open for further replies.
Back
Top