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.
Turning APM on or off changes the environment on its server. It runs as a job, so the job pill shows the progress and the change is recorded in the activity log.
Turn it on
- Open a site and pick the environment in the top bar.
- Open APM and select Enable.
- Choose how long it runs: 2, 4, 12, or 24 hours, or until you turn it off.
- 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.
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.
PHP engine
The PHP engine card shows what PHP runs with right now, read from the server: the PHP version, the number of PHP workers your plan gives, the memory limit of each worker, the maximum execution time, OPcache, the upload limit, and how many workers are busy. Select Change PHP settings to change the version or the limits. See PHP settings.
Keeping data
APM keeps 7 days. A range that starts earlier than that is refused.
API
PUT /v1/environments/{id}/apmturns APM on or off ({"enabled": true, "mode": "window_2h"}).GET /v1/environments/{id}/apm/statusGET /v1/environments/{id}/apm/overviewGET /v1/environments/{id}/apm/urls?sort=avg&filter=slow&q=shopGET /v1/environments/{id}/apm/url?name=/shop/GET /v1/environments/{id}/apm/alertsGET /v1/environments/{id}/php/engine
Not yet
- Traces of single requests (WordPress hooks and each query) are not recorded. APM shows totals per page instead.
- Redis time is not split out. It counts as PHP.
Related
Still stuck?
Email [email protected] with your site name and what you tried, or send us a message.