Slow TTFB, how to debug?

You are here:
Estimated reading time: 1 min

This usually happens when there’s a lot of processing in the background.

It’s uncertain what causes this, but it depends entirely on the context of the website, where it’s hosted and what’s loaded inside. It could be a faulty plugin, or a slow query (or multiple queries) and so on.

Here’s a couple of things you can try to debug this:

Enable debugging to see if there are PHP errors in the background

Follow this article to enable WP_DEBUG constant, and make sure to check if there are php errors generated.

Disable plugins, one by one

Given that the issue may come from a specific or multiple plugins, try disabling plugins one by one (and refresh in the meantime) to see if there are improvements.

It’s worth disabling Rey Core plugin too, but please know that this plugin acts as a pipeline in many situations and a lot of content passes through it (eg: main content, product grids, Global sections – Header, Footer, etc.) and while disabling it will obviously show an improvement, it’s likely happens because most of the content is not rendered anymore.

Install Query Monitor plugin

You can also install Query Monitor and get reports for the number of queries, duration and overall DB performance.

Here’s a screenshot of London’s demo Query Monitor profile . Try not to have a large number of queries. In the screenshot, there’s around 480 queries given that this page loads a large header with a lot of features, WooCommerce product grids, and other various elements that may need to query the DB.

Use Redis or Memcached

By definition, Redis and Memcached are both in-memory data storage systems. Memcached is a high-performance distributed memory cache service, and Redis is an open-source key-value store.

It’s probably best to ask your hosting support team if any of them is supported on your server.

Was this article helpful?
Dislike 0
Views: 172

Join the conversation