Why is my cpanel droplet TTFB so slow?

Posted June 29, 2020 2.1k views

I setup a cPanel install from the marketplace using CentOS 7.6 on a $20 droplet (4 GB, 2 vCPUs). Currently seeing extremely high TTFB on all of my wordpress installs compared to my $5 wordpress droplets.

$5 droplets I’m seeing 100-300ms TTFB, my cPanel sites even with server load under 0.1 I’m getting 500-3400ms TTFB (Yes, 3.4 seconds). The cPanel admin pages are fast, but all wordpress content is slow (frontend and admin backend).

I’m running PHP 7.4 with Apache, gzip, caching, etc. I’ve followed every performance guide I can find, but I need the sites to be more performant. I’m seeing slowness on sites with dozens of plugins and slowness on brand new fresh wordpress installs.

There has to be some cPanel or apache config that is setup differently for the marketplace install vs the Wordpress marketplace install and I really need guidance on where to look.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

FOUND THE PROBLEM! PHP-FPM is NOT enabled by default from the Digital Ocean cPanel marketplace install. (Digital Ocean support, you need to fix this immediately). I enabled that and all the sites are now blazing fast as I expect on my droplets.

To save you a google search, follow these steps:
1) Open WHM
2) Navigate to MultiPHP Manager
3a) Run a GTMetrix report against your site
3b) Set PHP-FPM status to ON and then click the convert all accounts to PHP-FPM option
4) Run another GTMetrix report against your site and smile
5) While you’re on this screen, make sure you have PHP 7.4 set as your default, or whatever the latest PHP version is when you’re reading this

  • Hello, @corvetteaustin2

    I believe that by default PHP-FPM is not enabled for your sites on cPanel/WHM. It comes really handy when you have a lot of traffic towards your server or general traffic spikes.

    You can also make sure you’re using the mod mpmevent or the mpmworker

    The MPM Event serves a single HTTP request across multiple threads. However, the MPM Event uses a dedication system and dedicates a thread to handle all live connections. The system allocates a request to the child threads only when it receives a request. This allows the threads instant availability after the request finishes.

    The MPM Worker causes Apache to fork into several processes so that a single crash does not kill the entire Apache process. Each forked process creates numerous threads, and a listener thread that listens for connections. This enables the system to serve multiple requests concurrently.

    Hope that this helps!


    • Hi @alexdo , I think it would be good to include some of this information in the cPanel marketplace documentation under a “performance considerations” section. Since the majority of my sites are going to be Wordpress (and so are other people’s websites), I’m not even kidding when I say this: PHP-FPM made my wordpress sites load 7x faster than the default suPHP.

      TTFBs were consistently 900ms-3500ms before the change. From my reading, suPHP isn’t even in development anymore and PHP-FPM is, so that should also be another consideration. Thanks for the information you provided as well.

      • Hello, @corvetteaustin2

        Using the suPHP PHP handler is among the most flexible and secure ways of serving PHP requests. With the suPHP handler selected along with using the suEXEC option, all PHP scripts will be executed as the user that owns the script, instead of running as Apache’s “nobody” user.

        The main benefit of using the suPHP handler is that it isolates one user on the server from the others. So if one account was compromised because of an exploit in one of your PHP scripts, the attacker would only be able to view or modify files owned by that particular user. It’s also among the easiest to use with CMS (Content Management Systems) such as Wordpress or Joomla. As typically these applications require the ability to create files on the server, and being that all of your files are owned by just one user, permission management is easy to configure. The main disadvantage of using the suPHP handler is that your PHP websites could be slower due to the additional overhead of having to run a separate PHP process per request.


Hi @nayanbaraiya2808,

I’m just posting the typical issues/resolutions to such cases. They are almost every time connected with two things - Website Optimization and Server/Droplet Optimization.

Let’s start with Server Optimization.

When looking at Server/Droplet Optimization, there are a few necessary services/packages that are universal.

  • The first one would be Server-side caching. Server cache is an umbrella term covering a number of different types of caching. This includes Content Delivery Network (CDN) caching, object caching, and opcode caching. Depending on what you want to achieve you might need one or the other. Usually, though, you can have all 3 types of caching as it shouldn’t interfere with your Website/App. I won’t go into more details about what each caching does as this post will become 3 pages long. There are multiple documents providing services/packages for each of the server-type caching.

  • Next would be using PHP-FPM (if your Website is using PHP of course). PHP-FPM is an efficient method on how to minimize the memory consumption and rise the performance for the Websites with heavy traffic. It is significantly faster than traditional CGI-based methods in multi-user PHP environments.

  • Another solution would be Database Caching. A database cache supplements your primary database by removing unnecessary pressure on it, typically in the form of frequently accessed read data. The cache itself can live in a number of areas including your database, application or as a standalone layer. Usually, for this kind of caching is being used Redis.

  • Apache NPM modules. If you are using Apache, you are using one of three NPM modules. Most certainly if you haven’t configured anything on it and have used the default configuration, you are using NPMPrefrok which is the most outdated one and thus the slower. I’ll recommend using one of the other two - NPMWorker and NPM_Event depending on your situation. Again, I would urge you to read more about these 3 and what is applied in which case.

  • Apache Workers. Basically, the Apache workers are equivalent to a room full of seats. These seats are the projection to your website. When someone opens your website, it’s like one person going to this room and sitting on one of the chairs. When the limit is reached, in order for a person to load your website, another one needs to close it. So basically, I’ll suggest increasing that value as well.

Those were the basic optimizations on a server level, let’s start with your Website/App

If you are using a CMS like WordPress, Magento, Joomla, Opencart or anything of the same matter, there will be plugins/addons. These addons can be very powerful if used correctly. The most helpful plugins are:

  • Caching Plugins
  • Image Optimization Plugins
  • Plugins that reduce redirections/requests
  • Plugins that reduce the size of JS and CSS files.
  • More often than not, there are a lot of JS and CSS files that are not being used, removing those should work as well

If you are not using a CMS, you’ll need to try and do what these plugins are doing manually.

Usually, Websites/Apps are slow because of a couple of reasons which range from too many requests or big images to a bunch of unnecessarily big JS or CSS files. Optimizing these whether you are using a Plugin or doing it manually is enough.

I hope this was helpful.