Wordpress/Drupal extremely slow Time To First Byte

wtptrs

Verified User
Joined
Jul 13, 2015
Messages
74
We have several Wordpress/Drupal sites configured on our Directadmin servers with a very slow time to first byte (sometimes 10+ seconds). We've ruled out any hardware/resource issues because even when we set up the same websites on a simple LAMP server with minimal resources (1vCPU, 1GB RAM, Apache, PHP 7, MariaDB 10.1, no extra caching except for OPcache, no extra Apache/DB server tuning), the Time to First Byte is still a lot faster than on our Directadmin servers with way higher specs.

The Directadmin servers we're testing this on are running on a freshly installed Debian 9 with Apache 2.4, PHP 7.4 (PHP-FPM with OPcache), and MariaDB 10.3, with just standard configurations. Does anyone here have any idea what could be the cause of this?
 

pmjcreations

Verified User
Joined
Jul 3, 2019
Messages
70
Hey @wtptrs,

Many internal and external factors affect TTFB.

Distance from visitors and origin server
The network connection of the visitor
Installed firewall and other security on the server or WordPress itself
Redirection if any
The network reliability of the DNS provider and registry
Your WordPress version, theme and activated plugin.
Protocols
A misconfigured cache plugin

You see the list is big, but 10+ seconds are too much.

Would you mind validating the factors that I listed above and see if you can make any improvements?

I am uncertain, but DA won't be the bottleneck here.
 

wtptrs

Verified User
Joined
Jul 13, 2015
Messages
74
Hey @wtptrs,

Many internal and external factors affect TTFB.

Distance from visitors and origin server
The network connection of the visitor
Installed firewall and other security on the server or WordPress itself
Redirection if any
The network reliability of the DNS provider and registry
Your WordPress version, theme and activated plugin.
Protocols
A misconfigured cache plugin

You see the list is big, but 10+ seconds are too much.

Would you mind validating the factors that I listed above and see if you can make any improvements?

I am uncertain, but DA won't be the bottleneck here.
Thanks for the the reply. The issue with the above is that we're testing the exact same site (a Drupal site in this case, just an import/export of the site data and database, no caching except for OPcache on both servers) on the same network, from the same location, same underlying hardware... on both a LAMP server and a server with a fresh Directadmin installation. The LAMP server doesn't have the TTFB issue. The only real difference I can think of right now is the PHP-handler (PHP-FPM on Directadmin vs. just a basic apache2/php7 package installation on the LAMP server), which we're testing at the moment.
 

ditto

Verified User
Joined
Apr 27, 2009
Messages
2,580
You might be right that it could be a difference in the PHP-FPM setup. Please note that default from DirectAdmin is to run PHP-FPM in ondemand mode, if you are running PHP-FPM in dynamic mode on your LAMP server, that could be it. Maybe try to change DirectAdmin to run PHP-FPM in dynamic mode then? That is what we do. Edit: However when reading your post again, it should not be 10 second delay just because of running PHP-FPM in ondemand mode. So likely it is something else at play.
 
Top