All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Help me optimize php-cgi for faster processing time :(
Hi guys,
I was trying a lot of things to optimize the speed of php-cgi processing time on my test wordpress website with around 30 queries,
Here is the result, I don't know if they are faster or just need to optimize more
just php-cgi (installed with LEA script): 0.1xx second to process around 30 queries.
php-cgi + memcached: 0.2xx second to process the same queries
php-cgi + varnish: 0.2xx second to process the same queries
I was trying to adjust PHP_FCGI_CHILDREN and PHP_FCGI_MAX_REQUESTS but it didn't help much
Is there any way to optimize to get faster processing time?
My VPS spec:
4 cores i7 2600k
15GB SSD (dd around 400MB/s)
Thank you all for reading my post
Giang
Comments
I would advise you to use php-fpm instead of php-cgi. For good config, check out the tuxlite.com scripts
php-fpm gave me slower processing time than php-cgi I've tested on difference VPS (with config from: https://github.com/cedricd/Server/tree/master/settings/php5/fpm)
Are you using some opcode optimizers/caches?
Install APC.
I forgot to mention. I've installed php-apc with default config
Ah ok, I noticed a 50% reduction in loading time with APC
APC didn't affect my php-cgi With or without, the processing time is the same
Giang,
I dont really get your result. How did you measure loading time(ab perhaps)? Did you make use of any front web server (nginx/lighttpd)?
And how come memcache takes longer to load a page. Perhaps you should also tell us what plugins are enabled in your wordpress instance.
On the other hand, loading a wordpress site in 0.1s is not that bad. Full page caching with memcached can take loading time to as low as 0.05s so not really a huge improvement.
Ha phan
I measure by Wordpress command:
Isn't it php-fastcgi or php-fcgi rather than php-cgi you should be using?
You haven't given much info on your memory and mysql setup. Are you on a dedicated or lightly loaded VPS?
It's php-cgi installed by LEA's script MySQL installed by this script as well, and it's a vps
Is it a shared environment ? Running as an apache module can speed things up. Obviously using more memory than your current set up
No, there is only one website (the website I'm talking in this topic) on my VPS, current ram usage is about 300MB and there is 1200M free ram.
I'm running Nginx because I don't know anything about manual config with Apache
php-fpm is actually just a process manager for php-fcgi which he seems to already be using.
Anyhow, personally I think your loading time issue lies with Wordpress and not with your webserver setup. Wordpress isn't exactly lightweight. To get a better result, measure the loading time on a PHP file that does nothing but echo('test'); - that will show you how long it takes to actually handle the request. Everything beyond that is out of the hands of your httpd or fcgi/fpm setup, and can be attributed to PHP itself.
(note: code is untested)