# Find what is making your site slow
Source: https://docs.webgee.com/en/performance/diagnose-slow-site-php-xray









Find out which part of your site is actually slow — a plugin, a database query,
an external API call — instead of guessing. Applies to shared, reseller and
Premium hosting.

Slowness is usually assumed to be a server problem. More often it is something
in the application: one plugin making a blocking HTTP request, or a query
without an index. PHP X-Ray traces real requests and shows you where the time
goes.

## Before you begin [#before-you-begin]

<Callout type="warn">
  X-Ray only collects data when Bolt-Cache is disabled and your sites are using
  **Proxy** mode. With Bolt-Cache on, the trace stays empty — this is the most
  common reason people think X-Ray is broken.
</Callout>

## Start a trace [#start-a-trace]

1. In cPanel, open **X-Ray**.

   <img alt="The X-Ray entry in cPanel" src="__img0" />

2. Select the domain or subdomain to trace.

   <img alt="The X-Ray trace configuration screen" src="__img1" />

3. Set the options:

   | Option              | What to use                                   |
   | ------------------- | --------------------------------------------- |
   | IP address          | Your own, to trace only your visits           |
   | Requests to collect | 10–20 is usually enough                       |
   | Timeframe           | Long enough for you to reproduce the slowness |

4. Start the trace, then visit the slow page a few times in your browser.

The **Collected Requests** column fills as traffic arrives.

## Read the results [#read-the-results]

Open the collected trace. It breaks each request down by where time was spent.

<img alt="An X-Ray trace showing database query timings" src="__img2" />

What to look for, roughly in order of how often it is the culprit:

* **One slow database query repeated many times.** Usually a plugin querying
  inside a loop. Object caching often fixes this outright — see
  [Enable Redis object caching](/en/performance/redis-object-caching-lscache).
* **A slow external HTTP call.** A plugin phoning home to a licence server or an
  API. The page cannot finish until that call returns.
* **One plugin dominating total time.** Disable it and re-trace to confirm.

## If nothing is collected [#if-nothing-is-collected]

* **Bolt-Cache is enabled.** X-Ray cannot see cached requests. Switch to Proxy
  mode.
* **You filtered to the wrong IP.** Check your current address and re-enter it.
* **The page is served from cache.** Add a unique query string —
  `?xray=1` — to bypass the cache while you test.

## Related [#related]

* [Enable Redis object caching](/en/performance/redis-object-caching-lscache)
* [Improve a slow WordPress or WooCommerce dashboard](/en/hosting/wordpress/how-to-improve-a-slow-wordpress-or-woocommerce-dashboard)
* [Understanding the 503 resource limit error](/en/performance/understanding-and-resolving-the-503-error-resource-limit-reached)
