Skip to main content

Extremely slow TTFB

Comments

13 comments

  • cPanelMichael
    Hello, You can find discussion of this topic on the following thread: Another TTFB thread Thank you.
    0
  • speedy200man
    Hello! The offered solution is litespeed, which costs alot of money! Isn't there any other solution ? I would expected for the system to work in a better way. If I install a centos and put services separately, the performance is ok. Everyone praises the cpanel, i paid money for it, and i cannot accept a new monthly fee to improve performance, when i don't even run high traffic sites. I know that are specific tweaks to the cpanel settings / mysql etc. Can anyone offer some solution to this ?
    0
  • Jcats
    I would... Upgrade to EA4, if you haven't done so already. Run EasyApache when done, choose the "All PHP Options + OpCache" profile. When you get to PHP options, search for 'opcache' as it doesn't enable by default for PHP 7 for some reason. Run it, when done in WHM go to MultiPHP Manager and change your site over to PHP 7(hopefully its compatible but it should be if you want to take advantage of the performance benefits of PHP7) In the same screen, enable PHP-FPM. I usually increase max children, and max requests, up to you. Install Redis cache: community.bigscoots.com/knowledge-base/cpanel-easyapache-4-installing-redis-redis-php-extension/ Once done, install W3-total-cache via your WP admin side: wordpress.org/plugins/w3-total-cache/ Once installed configure: Page Cache, Database Cache, and Object Cache to use Redis. You can enable minify as well but most of the time causes issues. Lastly, *not supported by cPanel, but you can install Nginx, best plugin to use: github.com/engintron/engintron One liner to install, takes a few minutes, and its ready to go. Oh, you could also utilize CloudFlare, this will help as well. If you do choose CloudFlare, you will need to do one more step for Nginx github.com/engintron/engintron/wiki/Engintron-&-CloudFlare One more thing I noticed is some of the static content you are using on your site is god awful slow, check attachment. You will want to either remove these images, or download them to your server and serve them from your server, stop linking to them from your site as they are slow slow! With all this, you should hopefully be seeing some better load times.
    0
  • speedy200man
    Thank you so much! Will try all of that and get back to you!
    0
  • abubin
    i am also having slow TTFB. I am suspecting this to be optimization issue with cpanel on centos 7. We started using centos 7 as a few of our servers are using centos 5 which is no longer supported by cpanel. So we had a centos 7 server running with cpanel running latest stable release. However, we notice our TTFB is extremely slow. It takes up to 10 secs before server starts responding back to the browser. We compared the same site to our centos 6 server and the TTFB is like 1 seconds only. On both servers we did not do any heavy optimization. Both cpanels are almost at default settings. We already tried GZIP compression but that doesn't help with TTFB. We are going to try installing mod_pagespeed next but this shouldn't have been necessary as fresh cPanel should have been optimized enough without needing third party software to get it to "usable" condition. BTW, we are using EA4 with php56 if there is helpful information. We are going to try some of the suggestions provided by jcats.
    0
  • speedy200man
    Hello! Just writing a short update. It seems that the biggest problem was with the router. Although it was a very good router with good specs, I do not know why but it choked the connection. My server is now connected directly to the internet and the speed is considerably better. I know cpanel does not encourage setting up behind NAT, but still, the lag was enormous. I can't say if the router is to blame or if it's cpanel. I will keep you posted with my future findings here, as soon as I have results.
    0
  • Danks
    I had a similar issue and mine turned out to be from mod_security rules (using a commercial rule set). The ones with dns lookups were the cause like rbl and others. There is no slowdown with this rules using Litespeed, but there is with apache - so another win for litespeed if you are having slow first byte.
    0
  • James T Snell
    I had a similar problem with an Apache server running on CentOS 7. I disabled Apache modules one at a time to see if I could find an issue in one of them. When I disabled the proxy module, my site started consistently loading pages under 900ms. Before that, some loads would take over 21000ms! I would guess that my virtual host or server could have something misconfigured with respect to mod_proxy, but since I don't at all need that module on this server, I don't mind simply leaving it disabled. I hope that helps someone.
    0
  • cPanelMichael
    Hi @James T Snell, Keep in mind the Apache Proxy module is utilized as part of the "Proxy Subdomains" feature: Proxy Subdomains Explanation - cPanel Knowledge Base - cPanel Documentation Disabling that module will prevent the proxy subdomains feature from working. Thank you.
    0
  • inspiredearth
    In the same screen, enable PHP-FPM. I usually increase max children, and max requests, up to you.

    Thanks for this guide, and the related links. Working through them now. This guide help.bigscoots.com/cpanel/cpanel-easyapache-4-installing-redis-and-redis-php-extension, by the way, is exceptionally helpful. Much appreciated. Any suggestions on how to determine what to set max children and max requests to? You say you normally increase them, and I suspect I should to. But by how much? Cheers...
    0
  • Jcats
    Depends mainly on your available memory, but you can use this script: github.com/jcatello/bigscoots/blob/master/chkphpfpm Set it up on a 1 minute cronjob Change out the email and then, anytime you hit max children, it will send you an email letting you know. If its pretty frequent that you get the emails, then definitely increase it as it will cause slow load times for viewers while they wait for a process to free up and/or eventually just timeout completely for the viewer. You can look at the processes and take an average of how much memory they are using, and then basically use that to judge how many processes you could spawn if needed without running out of memory
    0
  • CrazySerb
    I had a similar problem with an Apache server running on CentOS 7. I disabled Apache modules one at a time to see if I could find an issue in one of them. When I disabled the proxy module, my site started consistently loading pages under 900ms. Before that, some loads would take over 21000ms! I would guess that my virtual host or server could have something misconfigured with respect to mod_proxy, but since I don't at all need that module on this server, I don't mind simply leaving it disabled. I hope that helps someone.

    How did you manage to disable mod_proxy on its own? I tried to do so in EasyApache with any of the mod_mpm_* modules and it would disable all the modules as well. As in, it wouldn't let me set up a working/active MPM module in EasyApache without keeping the mod_proxy turned on. So how would you go about disabling the mod_proxy then?
    0
  • cPanelMichael
    How did you manage to disable mod_proxy on its own?

    Hello @CrazySerb, Uninstalling Mod_Proxy isn't supported at this time due to it's requirement for features such as proxy subdomains to work. Internal case CPANEL-23090 is open to prevent users from toggling mod_proxy off in EA4 UI, as it will lead to a loop where it suggests choosing a new MPM and then automatically enables mod_proxy again when a new MPM is chosen. thank you.
    0

Please sign in to leave a comment.