Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Extremely slow TTFB

Discussion in 'Workarounds and Optimization' started by speedy200man, Feb 20, 2017.

  1. speedy200man

    speedy200man Registered

    Joined:
    Feb 20, 2017
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bucharest, Romania
    cPanel Access Level:
    Root Administrator
    Hello, this is my first post as a cpanel owner.
    Please be so kind and advise me on how to improve my time-to-first-byte.
    I have a dell R610 (2xsix-core) with 80 gb of ram, fiber connection, centos 7 and latest cpanel. My disk configuration is 2xraid 1 for the os and 4 disks in raid 5 (sas @ 10K rpm). My cpanel server is behind a gigabit new router, that forwards the necessary ports to the server.
    Whenever I access the cpanel address directly, speed seems just fine, but whenever i access any website, it takes from 4 to 17 seconds until is starts loading the website. Until then it just sits there, looking for the domain.
    I have done some tests and if the webpages are static, they load pretty fast. Others are simple wordpress sites without crazy plugins and I have tons of resources available.
    Can you please give me some sort of advice to improve my ttfb ?
    You can check the ttfb value for this website as an example: e-zine [dot] ro
    Thank you!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can find discussion of this topic on the following thread:

    Another TTFB thread

    Thank you.
     
  3. speedy200man

    speedy200man Registered

    Joined:
    Feb 20, 2017
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bucharest, Romania
    cPanel Access Level:
    Root Administrator
    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 ?
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    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.
     

    Attached Files:

    #4 Jcats, Feb 20, 2017
    Last edited by a moderator: Feb 20, 2017
    Del Drago and cPanelMichael like this.
  5. speedy200man

    speedy200man Registered

    Joined:
    Feb 20, 2017
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bucharest, Romania
    cPanel Access Level:
    Root Administrator
    Thank you so much! Will try all of that and get back to you!
     
  6. abubin

    abubin Well-Known Member

    Joined:
    Dec 7, 2004
    Messages:
    402
    Likes Received:
    3
    Trophy Points:
    168
    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.
     
  7. speedy200man

    speedy200man Registered

    Joined:
    Feb 20, 2017
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Bucharest, Romania
    cPanel Access Level:
    Root Administrator
    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.
     
    cPanelMichael likes this.
  8. Danks

    Danks Active Member

    Joined:
    Oct 10, 2001
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    303
    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.
     
    cPanelMichael likes this.
Loading...

Share This Page