Skip to content

APM

Turn on APM to see which pages make a WordPress site slow, and whether the time goes to PHP, the database, or outside calls.

APM shows where a WordPress site spends its time. While it is on, Avaloi records every request that reaches PHP: the page or endpoint, how long it took, and how much of that time went to PHP, the database (MySQL), and calls to other services. Open your site, then APM, and select Enable APM.

Turning APM on or off changes the environment on its server. It runs as a job, so the Jobs tab under the bell shows the progress and the change is recorded in the activity log.

Turn it on

  1. Open a site and pick the environment in the top bar.
  2. Open APM and select Enable APM. The button shows only while APM is off.
  3. Choose how long it runs: 2, 4, 12, or 24 hours, or until you turn it off.
  4. Select Enable APM.

The first numbers show within a minute. APM turns itself off when the time you chose ends, and the numbers it collected stay for 7 days.

APM adds a little work to each PHP request while it runs, mostly to time every database query. With APM off it adds nothing. Short windows are best while you look for a problem.

You can also turn APM on and off from the APM card on the Tools tab. The card and the APM page use the same switch, so they always agree. While APM is off, the APM item leaves the site sidebar for that environment. A bookmark to the APM page still opens it: the page says APM is off and has one Enable APM button. Turning APM on brings the sidebar item back at once.

Turn it off

Select Disable on the APM page or on the APM card in Tools. Disabling stops collection at once. The data APM already collected stays for 7 days, so you can still read it on the APM page until it expires.

What the page shows

  • Throughput: requests a minute, and the total in the range.
  • Average response: the average time of a request, and the time 95 percent of requests stayed under.
  • Error rate: the share of requests that ended in a server error (5xx).
  • Slowest transaction: the page with the highest average time.
  • Overall transaction time: a chart of the average request over time, split into PHP, MySQL, External, and Other. Other is the web server and responses served straight from the page cache. Point at a bar to see its numbers.
  • Slowest transactions: one row per page or endpoint, with its share of all time, total time, slowest time, average time, and how often it runs. Search by URL, show only rows with errors, slow rows, or rows that miss the cache, and sort by any column. The menu at the end of a row copies or opens the URL.

Pages that differ only by an ID count as one row: /wp-json/wp/v2/posts/12 and /wp-json/wp/v2/posts/40 both show as /wp-json/wp/v2/posts/:id. The query string is left out.

Select a transaction to open its details: where its time goes, a chart of it over time, and its slowest requests with their PHP, database, and memory numbers.

Findings

Above the chart, Findings explains what needs attention in plain words:

  • PHP was restarted. Avaloi checks PHP every 10 seconds and restarts it after three failed checks. The finding says why, and when the PHP slow log points to one plugin or theme, it names it. Select Show the slow log to see what the slowest requests were running.
  • PHP ran out of workers. All PHP workers were busy at some point, so visitors waited. Cache more pages, speed up the slowest transactions, or move to a plan with more PHP workers.
  • Slow requests, a high error rate, and a very slow page from the last hour.

Findings about PHP restarts and workers show even when APM is off.

Only APM on this page

The APM page shows only APM. The PHP version and PHP limits are on the PHP engine card in Tools. See PHP settings.

Keeping data

APM keeps 7 days. A range that starts earlier than that is refused.

API

  • PUT /v1/environments/{id}/apm turns APM on or off ({"enabled": true, "mode": "window_2h"}).
  • GET /v1/environments/{id}/apm/status
  • GET /v1/environments/{id}/apm/overview
  • GET /v1/environments/{id}/apm/urls?sort=avg&filter=slow&q=shop
  • GET /v1/environments/{id}/apm/url?name=/shop/
  • GET /v1/environments/{id}/apm/alerts
  • GET /v1/environments/{id}/php/engine

What APM does not record

APM keeps totals per page and the slowest requests. It does not record traces of single requests through each WordPress hook and query, and there are no trace views in the dashboard or the API.

Not yet

  • Redis time is not split out. It counts as PHP.

Still stuck?

Email [email protected] with your site name and what you tried, or send us a message.