• Hey WordPress experts,

    I’m having trouble with my WordPress site and cannot for the life of me figure out what’s causing it. For some reason, random files seem to have TTFBs of 40 seconds or over a minute, causing the site to load incredibly slowly. So far here are the steps I’ve taken or things I’ve looked at:

    • Logs of the Digital Ocean droplet’s memory usage, bandwidth, CPU, and Disk I/O show that all are consistently low. So it doesn’t appear to be a resources issue.
    • After updating all the components didn’t work, we used the Duplicator plugin to literally pickup the site and move it to a new server on Ubuntu 18.04. The problem still exists.
    • We tried disabling all plugins, and the problem still existed, so it doesn’t seem to be caused by a faulty plugin either (we don’t have many active ones anyway).
    • Rebooting the server seems to fix the problem temporarily (e.g. for an hour or so).
    • We use cloudflare as a CDN and everything seems fine there – directly accessing our site by IP also has the problem.

    The site has been running fine for over a year and yet in the last 2 weeks has just become unusable, and I have no idea what’s changed. If anyone could provide some insight, I’d be hugely appreciative.

    Also, after the problem starts occurring, we also see the following in the Site Health page in reference to the REST API and a loopback request:

    Error: [] cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    A few things to check, as this is almost certainly not a WP problem:

    1. Check your swap partition? Is it getting used? Is it full?
    2. run an fsck on your file systems. Maybe something is hosed and needs to be fixed.
    3. Check the tuning of your mysql/maria server.
    4. Disable your firewall as a test. Does that make any difference?
    5. Are you maxing out on worker threads for your web server and/or PHP processes?

    Thread Starter meisi11

    (@meisi11)

    Thanks for the very thorough answer!

    1. It doesn’t look like we have a swap partition at all (“swapon –show” returns nothing, and “free -m” shows all zeroes). We’re using less than 30% of our memory though.
    2. fsck results seem fine, and since we just moved the server and only copied over the WordPress files I think it makes sense it’s probably something else.
    3. I did install the Query Monitor and one point and just did again – even when the pages take a long time to load, the queries are all completing in less than a second. It’s usually quite often CSS or JS files that take a long time to load. Unless you meant there’s something else I need to check here?
    4. Disabling the firewall didn’t seem to make a difference.
    5. I wasn’t too sure how to measure these – I did increase the MaxRequestWorkers value in apache’s mpm_prefork.conf file from 150 to 1500 but it doesn’t seem to have done much. I also looked, and it doesn’t seem like php-fpm is running on our machine, and I haven’t managed to figure out anything else related to this. I did increase the php.ini memory limit from 128MB to 512MB though. Is there something I’m missing?

    @meisi11 Check your apache error logs and see if you can find which file/line the error is occurring in. What’s happening is that there’s an HTTP request (via curl) that’s blocking the loading of everything else. This is almost guaranteed to be problem with a plugin or theme.

    You can also try disabling each one of your plugins (one at a time) and see when the delay stops, and you can narrow it down. It could also be your theme, so try that too.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Random large TTFBs slowing down website’ is closed to new replies.