PHP-FPM (FastCGI Process Manager) + Wordpress

Dion

Member
Since we've been talking about using Nginx as a reverse proxy, here's something to keep in mind when using NginxCP.

If you rebuild Apache with EasyApache, you will lose the mod_remoteip module installed by NginxCP. That means all reported IP addresses will be 127.0.0.1 or your host IP address, depending on how you have the log set up. Fixing this requires changing the main.local and vhost.local EasyApache templates, then distilling Apache from those templates.

I found this out the hard way.

Also note that NginxCP does not uninstall properly. It also requires a change to the EasyApache templates and distilling Apache.
 

Dimitris

New Member
Sounds like the best setup you can do on top of cPanel :)
Is the zend opcache still an option? I am trying to install it through pecl, along with apcu, but I was getting errors that they are in beta version, so I need to install them with the channel command.
I switched to SSH, but then I got a message that

could not extract the package.xml file from "/root/tmp/pear/cache/zendopcache-7.0.3.tgz"
Download of "pecl/zendopcache" succeeded, but it is not a valid package archive
Error: cannot download "pecl/zendopcache"
Download failed
install failed
Same with apcu

Any ideas? I am on SSD-1 VPS

Thanks a lot for your help
 

KH-Jonathan

Director of Managed Services
Staff member
Is the zend opcache still an option? I am trying to install it through pecl, along with apcu, but I was getting errors that they are in beta version, so I need to install them with the channel command.
I switched to SSH, but then I got a message that



Same with apcu

Any ideas? I am on SSD-1 VPS

Thanks a lot for your help
Code:
pecl install ZendOpcache-beta
 

Dimitris

New Member
Perfect Thanks a lot

However, after installing zendopcache, I am getting internal server errors. apcu seems to work fine, although it does not like handling user sessions...

any ideas?
 

Dion

Member
Which version of PHP are you running? Zend Opcache is built into PHP 5.5+, and enabling it requires adding a single line to php.ini.

I have had so many problems with object caching that I will never again install one. Sessions were definitely a problem; inability to change application settings was another.

You have a SSD-1 VPS so you have blazing-fast disk access, but memory is at a premium. Save the memory and get rid of APCu...
 

KH-Jonathan

Director of Managed Services
Staff member
Which version of PHP are you running? Zend Opcache is built into PHP 5.5+, and enabling it requires adding a single line to php.ini.

I have had so many problems with object caching that I will never again install one. Sessions were definitely a problem; inability to change application settings was another.

You have a SSD-1 VPS so you have blazing-fast disk access, but memory is at a premium. Save the memory and get rid of APCu...
What do you run that had issues with it? Practially everything we run on our network has some for of opcode caching. Few things are still running on APC but I'm working on getting everything moved over to ZendOpcache. This forum runs ZendOpcache. Helpdesk is still on APC but will be converted soon - never faced an opcode caching-induced problem and it significantly speeds things up.

SSDs are fast, but RAM will always be faster.
 

Dion

Member
I think you misread what I wrote. I will not use an object cache again. I cannot imagine running without an opcode cache.
 

Dimitris

New Member
I think you misread what I wrote. I will not use an object cache again. I cannot imagine running without an opcode cache.
Opcode cache is completely different than object cache. Ideally you need both. Opcode cache for not converting php to intermediate code each time, and object caching for not executing the code or calling the db each time.

What do you run that had issues with it? Practially everything we run on our network has some for of opcode caching. Few things are still running on APC but I'm working on getting everything moved over to ZendOpcache. This forum runs ZendOpcache. Helpdesk is still on APC but will be converted soon - never faced an opcode caching-induced problem and it significantly speeds things up.

SSDs are fast, but RAM will always be faster.
I am running a small php site under php5.5.19. All php died when I installed zendopcache through pecl.

APCu is different than APC in that they forked it to remove the opcode cache in favor of zendopcache, while keeping the object and session cache functionality.
 

Dion

Member
Opcode cache is completely different than object cache. Ideally you need both.
Until programs that try to use an object cache (I'm looking at you, W3TC and WP Super Cache!) stop being brain-dead about where and how objects are being used, I will stay away from using an object cache. The dangers of brain-dead applications far outweigh the benefits of an object cache, particularly on an SSD VPS. However, if you believe your VPS is in need of a snake oil treatment, please ignore the above. ;)

I am running a small php site under php5.5.19. All php died when I installed zendopcache through pecl.
Zend Opcache is built into PHP 5.5+, and enabling it requires adding a single line to php.ini.
In all likelihood the PECL install process overwrote the correct opcache.so file. You should remove the "extension=opcache.so" line from php.ini, restart Apache, and then use PECL to remove what you installed. Now you'll need to run EasyApache to rebuild PHP in order to re-generate the correct opcache.so file. Once you do that, put the "extension=opcache.so" line back in php.ini, and you'll be all set. Alternately, you could open a support ticket...
 

KH-Jonathan

Director of Managed Services
Staff member
I think you misread what I wrote. I will not use an object cache again. I cannot imagine running without an opcode cache.
Yep, total brainfart. Object caches are a PITA and none of our stuff uses them.
 
Hi Friends.

One question:
Finally some nginx with Cpanel installed here in our VPS? Such has been your experience?
I have an application in PHP and MySQL and I have recommended people knowhost install nginx paw improve the speed of response and I have more than 40 concurrent users on my application and all connecting from the same IP limiting the number of sockets. ...

How was your experience with installation ...
And after the installation on the use ....

Stay tuned to your comments.

Thank you
 

Dion

Member
I tried the "solutions" for using ngins through cPanel. All of them have problems, and one of them (cpxstack) has the very real potential (he says, having experienced it first-hand) of breaking cPanel since it blindly overwrites cPanel templates.

I've done quite a bit of experimenting with nginx and Apache on non-cPanel sites. My experience has been that, consistently, Apache 2.4.12+, MPM-Event, PHP5.5+, and PHP-FPM is faster and uses less memory than nginx, PHP5.5+, and PHP-FPM. There are two caveats, however.

The first is that the PHP-FPM pool configuration is much trickier in Apache than it is in nginx, and even slight changes can have a large effect on performance on busy sites. The second is that Apache's mod_proxy_fcgi is still a work in progress, and certain things (HTTP error handling in particular) require creative hacks in the Apache configuration to work properly.

I'm using PHP-FPM (self-installed) with Apache 2.4.16, PHP 5.5.27, and MPM-Event on my KH VPS with cPanel. I cannot imagine using anything else. Be aware that activating PHP-FPM and mod_proxy_fcgi in EasyApache requires the addition of custom compile options.
 

VoX

New Member
Very nice thread here, guys! I'm new to KH and still moving in, and this is the info I'm very interested in. Taking notes ;)
 

themisfit

New Member
@KH-Jonathan
I'm looking at buying a new SSD VPS and I'm wondering if this is still the best setup for hosting Wordpress sites?

-DSO/mod_ruid2
-Apache 2.4.10 (or newest version)
-MPM-Event
-Nginx Reverse proxy
-PHP 5.5.18 (or newest version)
-Zend Opcache

I this all something that can be setup for me by KnownHost support?
 
Last edited:

KH-DanielL

New Member
Staff member
I'm looking at buying a new SSD VPS and I'm wondering if this is still the best setup for hosting Wordpress sites?
If you have not opened a support ticket yet, we can provide some more info for your specific situation.

This topic hasn't been updated in a while and cPanel has introduced a lot of new features recently, including native support for PHP-FPM in EasyApache 4. I've been playing around with this and thought I would share some information based on what our support team has observed across several servers, as well as personal experience.

Unless your server meets some fairly specific criteria such as single-account with a very high rate of requests per second, our general recommendation for most users is mod_prefork with mod_ruid2, DSO as the PHP handler. If some additional speed is needed, zend opcache can be used. I have used cPanel's PHP-FPM personally on a test server that receives limited traffic and found that mod_ruid2 with DSO was as fast or usually faster than PHP-FPM. FPM also adds more complexity to the server and there are some settings in there that need to be tweaked and sometimes don't work very well out of the box. But if you're receiving a LOT of traffic on one domain, you might not see the same behavior I observed.

If you want WordPress sites to fly, making sure the server is running EasyApache 4 so you can use PHP 7, mod_ruid2, and DSO is generally the way to go. On a well optimized WordPress without heavy plugins or customization I'm approaching 1 second full load times and time to first byte of 100-200 ms with PHP 7, prefork, DSO, OPcache.

nginx for cPanel servers is only available through 3rd party plugins right now, and they all have a few drawbacks and introduce more potential issues. If you want something more efficient than Apache I'd recommend Litespeed. Otherwise, services like CloudFlare can provide a caching reverse-proxy CDN without having to adjust server configuration.
 

WebEndev

Member
If you have not opened a support ticket yet, we can provide some more info for your specific situation.

This topic hasn't been updated in a while and cPanel has introduced a lot of new features recently, including native support for PHP-FPM in EasyApache 4. I've been playing around with this and thought I would share some information based on what our support team has observed across several servers, as well as personal experience.

Unless your server meets some fairly specific criteria such as single-account with a very high rate of requests per second, our general recommendation for most users is mod_prefork with mod_ruid2, DSO as the PHP handler. If some additional speed is needed, zend opcache can be used. I have used cPanel's PHP-FPM personally on a test server that receives limited traffic and found that mod_ruid2 with DSO was as fast or usually faster than PHP-FPM. FPM also adds more complexity to the server and there are some settings in there that need to be tweaked and sometimes don't work very well out of the box. But if you're receiving a LOT of traffic on one domain, you might not see the same behavior I observed.

If you want WordPress sites to fly, making sure the server is running EasyApache 4 so you can use PHP 7, mod_ruid2, and DSO is generally the way to go. On a well optimized WordPress without heavy plugins or customization I'm approaching 1 second full load times and time to first byte of 100-200 ms with PHP 7, prefork, DSO, OPcache.

nginx for cPanel servers is only available through 3rd party plugins right now, and they all have a few drawbacks and introduce more potential issues. If you want something more efficient than Apache I'd recommend Litespeed. Otherwise, services like CloudFlare can provide a caching reverse-proxy CDN without having to adjust server configuration.
Awesome summary of the current situation with PHP-FPM :)

Once someone develops a STABLE third party Nginx plugin for reverse proxy, then we will have a super combo. Hopefully cPanel themselves develop one...
 

Carson

New Member
If you have not opened a support ticket yet, we can provide some more info for your specific situation.

This topic hasn't been updated in a while and cPanel has introduced a lot of new features recently, including native support for PHP-FPM in EasyApache 4. I've been playing around with this and thought I would share some information based on what our support team has observed across several servers, as well as personal experience.

Unless your server meets some fairly specific criteria such as single-account with a very high rate of requests per second, our general recommendation for most users is mod_prefork with mod_ruid2, DSO as the PHP handler. If some additional speed is needed, zend opcache can be used. I have used cPanel's PHP-FPM personally on a test server that receives limited traffic and found that mod_ruid2 with DSO was as fast or usually faster than PHP-FPM. FPM also adds more complexity to the server and there are some settings in there that need to be tweaked and sometimes don't work very well out of the box. But if you're receiving a LOT of traffic on one domain, you might not see the same behavior I observed.

If you want WordPress sites to fly, making sure the server is running EasyApache 4 so you can use PHP 7, mod_ruid2, and DSO is generally the way to go. On a well optimized WordPress without heavy plugins or customization I'm approaching 1 second full load times and time to first byte of 100-200 ms with PHP 7, prefork, DSO, OPcache.

nginx for cPanel servers is only available through 3rd party plugins right now, and they all have a few drawbacks and introduce more potential issues. If you want something more efficient than Apache I'd recommend Litespeed. Otherwise, services like CloudFlare can provide a caching reverse-proxy CDN without having to adjust server configuration.
This is my current setup:
Apache 2.4
config
config-runtime
mod_authn_dbm
mod_authn_socache
mod_bwlimited
mod_cgi
mod_dbd
mod_deflate
mod_expires
mod_headers
mod_mpm_prefork
mod_proxy
mod_proxy_http
mod_remoteip
mod_ruid2
mod_security2
mod_ssl
mod_unique_id
mod_version
tools

PHP 7.0


And I believe I'm running DSO
 

voxmed

New Member
Dear @KH-Jonathan @KH-DanielL can you take a look on my server configs and settings?

I have wordpress site on my SSD-2 VPS package, with average 4K daily pageviews. Sometimes it has surge traffics from soc-med shares. I've checked my Google analytics and it was only 70 pageviews per minute traffics that brought the servers (nameserver and mysql) down. My concern is to anticipate this in the future. Do you have any suggestions? Since my site is using SSL, is it possible to employ Varnish and Nginx as reverse proxy? Will it help to handle this kind of traffics surge?

FYI my wordpress site now is using Zend OPcache and diskcache (using WP Super Cache).

I need some advices and assistances from experienced experts here.. :)
 

KH-Jonathan

Director of Managed Services
Staff member
Varnish + cPanel never works out well. The only existing Nginx plugins have many flaws as well.

Litespeed would be a good option for you. I'd absolutely get rid of WP Supercache. That thing is an evil mess.

LSCache for WP works really well, and there's a memory-based caching plugin I found that works really really well but I can't remember it's name right now :(
 
Top