PHP-FPM (FastCGI Process Manager) + Wordpress

Dion

Member
Having to update configs manually every time a customer wants to add a cPanel account or domain just isn't feasible.
And I'm sure this is the reason why PHP-FPM isn't supported in cPanel. FPM pools are an incredible and powerful feature, but fine-tuning pool configurations is a royal pain. One last comment...the "on-demand" manager is fantastic for smaller sites, and it requires almost no fine-tuning to work well. It was a recent addition to PHP-FPM.

Sorry about hijacking the PHP-FPM topic... :oops:
I might start another topic spun around my questions, so as not to interfere here.....
Thanks!
Please feel free to hijack...this has turned into a great topic!
 

KH-Jonathan

Director of Managed Services
Staff member
Hi Jonathan,

Sounds good.

I's like to find a way to test a config on a KH VPS (or server), for stability, and performance.

What I'm thinking is this:
  • Apache 2.4.10 MPM Event (question below)
  • PHP 5.5.17 DSO + mod_ruid2
  • Zend Opcache
  • Nginx ((http://www.nginxcp.com/) as reverse proxy
Sounds like the best setup you can do on top of cPanel :)

Please feel free to hijack...this has turned into a great topic!
Agreed. There is a ton of valuable information in here. I love a good topic like this.
 

WebEndev

Member
  • Apache 2.4.10 MPM Event (question below)
  • PHP 5.5.17 DSO + mod_ruid2
  • Zend Opcache
  • Nginx ((http://www.nginxcp.com/) as reverse proxy

OK. And any case you can make for adding Memcached, Varnish, and/or mod_pagespeed to the mix?
Memcached and mod_pagespeed would be great also.

@Jonathan -

Had any experience with mod_pagespeed, in combination with the above setup I mentioned?

Can MPM Event be done on a KH VPS? Or does it require a dedicated?

I would be willing to sign up for another VPS (SSD), to work with KH support to create this setup. I would then test it with a live site, and report the differences to (in comparison to my current setup).
But I don't want to move on it unless I know if Apache 2.4.10 is available in MPM Event, since it sounds like that is the preferable way to run it (per Dion).
Thoughts?
 

Dion

Member
I'm using MPM-Event right now on a KH SSD-2 VPS and it's blinding fast. My setup: Apache 2.4.10, MPM-Event, Nginx Reverse proxy, PHP 5.5.18, PHP-FPM, Zend Opcache.

Personal opinion...I have yet to find a single good reason to install mod_pagespeed. Everything it attempts to do should be done in other places on a site. According to a couple colleagues who installed it (and removed it shortly afterwards), it dramatically increases server load. And to be blunt, Google has such a bad track record with its products covertly "calling home" that I don't trust installing it on my server. (FWIW, that's why I will never use Chrome as a browser.)
 

WebEndev

Member
Hi Dion,

Running PHP-FPM would not be realistically feasible for me though, because of the manual updates every time a new cPanel account/domain is added:

Precisely. Having to update configs manually every time a customer wants to add a cPanel account or domain just isn't feasible.
Maybe DSO/mod_ruid2 with Apache 2.4.10, MPM-Event, Nginx Reverse proxy, PHP 5.5.18, and Zend Opcache would still be an improvement over
PHP 5.4.33/APC/DSO/mod_ruid2/Apache 2.2.27/Nginx Reverse proxy?

I really would lovd PHP-FPM though... :( Your setup sounds sweet...
 

KH-Jonathan

Director of Managed Services
Staff member
Personally I've never used mod_pagespeed. I've installed it for folks, but I don't really see the point.

I'm also kinda with @Dion that I'm not too trusting of Google these days myself.
 

WebEndev

Member
Maybe DSO/mod_ruid2 with Apache 2.4.10, MPM-Event, Nginx Reverse proxy, PHP 5.5.18, and Zend Opcache would still be an improvement over
PHP 5.4.33/APC/DSO/mod_ruid2/Apache 2.2.27/Nginx Reverse proxy?
Jonathan - what do you think of the above?
 

WebEndev

Member
Hi Jonathan,

Would it even be worthwhile doing Apache 2.4.10 and MPM-Event, if PHP-FPM is not used though? (i.e. DSO/mod_ruid2 in place of PHP-FPM)

I'm wondering if there would be no performance improvement, or even decrease in performance, with Apache 2.4.10 in that situation?

Also - wouldn't Apache 2.4.10 and MPM-Event use more memory than 2.2.27 and prefork? That would be a problem on a VPS with several sites running on it....

Thanks for putting up with my annoying questions.... :confused::)
 

KH-Jonathan

Director of Managed Services
Staff member
Hi Jonathan,

Would it even be worthwhile doing Apache 2.4.10 and MPM-Event, if PHP-FPM is not used though? (i.e. DSO/mod_ruid2 in place of PHP-FPM)

I'm wondering if there would be no performance improvement, or even decrease in performance, with Apache 2.4.10 in that situation?

Also - wouldn't Apache 2.4.10 and MPM-Event use more memory than 2.2.27 and prefork? That would be a problem on a VPS with several sites running on it....

Thanks for putting up with my annoying questions.... :confused::)
I've never been able to notice any measurable difference in 2.2 vs 2.4 though I've not tested them that in depth. Most tests on the internet show only minor improvements in 2.4 over 2.2 in regards to speed. I've never tested any handlers across 2.2/2.4 except for prefork.
 

Pie

New Member
Nope, just tweak the amount of RAM assigned to ZendOpcache/APC. I do recommend Zend over APC now so that's all I'd change in @WebEndev's setup.
Please allow me to pick your brain again, Jonathan :)

With SSD-2's 2 GB of RAM and a single +-15k pv/day blog seeing occasional traffic spikes of hundreds of simultaneous connections a few times a week, how much memory would you allocate to WordPress, Zend OpCache, MemCached and Nginx microcache?
 

KH-Jonathan

Director of Managed Services
Staff member
Wordpress doesn't get it's own memory allocation. If there's some plugin that tries to accomplish this I'm not sure exactly what it'd do. I recommend a 128M memory_limit in php.ini if that's what you mean.

For ZendOpCache this depends upon the side of the codebase of your site. Generally 32-64M for a single site is plenty. I set most things I setup internally to 128M just because RAM is cheap and why not, but generally things use under 32M.

Memcached is again going to depend upon what your application needs. I'd guess again 32-64 would be plenty. Giving it more than necessary will not help you any, that's like saying adding disk space will make disk access faster - it just doesn't work that way.

I've never used Nginx's microcache. I usually mount /tmp to RAM and let it do it's caching there so it's technically a RAM cache and I flush that once an hour. This usually maintains a size of <32M memory.
 
  • Like
Reactions: Pie

Pie

New Member
Thanks for all the help, everyone and Jonathan in particular. Performance is RIDICULOUSLY good.

I've been load testing the blog and only when I started blasting 100 clients per second to a single.php for 60 seconds straight, the average response time went up from 108 ms to 2507 ms. That kind of traffic would have killed my previous "WordPress optimized" hosting plan!

UPDATE: My current setup is
  • Apache 2.4.10 MPM Event (question below)
  • PHP 5.5.17 DSO + mod_ruid2
  • Zend Opcache
  • Nginx ((http://www.nginxcp.com/) as reverse proxy
  • Memcached
  • Plugins: WP-FFPC & Autoptimize
 
Last edited:
  • Like
Reactions: VoX

Dion

Member
My guess is that your site would be faster with heavy loads if you dumped the two WP plugins and possibly Memcached as well.

But then again, I'm of the opinion that just about every WP cache plugin is little more than snake oil. ;)
 
  • Like
Reactions: VoX

Pie

New Member
My guess is that your site would be faster with heavy loads if you dumped the two WP plugins and possibly Memcached as well.

But then again, I'm of the opinion that just about every WP cache plugin is little more than snake oil. ;)
Interesting suggestion. I'll test for sure.
 

KH-Jonathan

Director of Managed Services
Staff member
My guess is that your site would be faster with heavy loads if you dumped the two WP plugins and possibly Memcached as well.

But then again, I'm of the opinion that just about every WP cache plugin is little more than snake oil. ;)
I have to agree. They all try to do disk-based garbage. Not aware of any that are purely RAM-based as they should be.
 
Top