Just enough checks to find the usual Magento performance suspects before You start profiling.
When a store gets slow, the cause is very often boring: an indexer stuck as invalid, a cache type somebody disabled and forgot, a cron backlog of thousands of pending jobs, a config setting nobody switched for production. Checking all of that by hand means a handful of CLI commands and a few SQL queries.
diagnose-performance runs those checks in one call and returns findings, each with a severity (info, warning, critical), a description and a suggested fix. The obvious stuff gets ruled out before anyone opens a profiler.
The checks
One required parameter, check:
check |
What it analyzes |
|---|---|
all |
all six below |
indexes |
invalid or outdated indexer status |
cache |
disabled cache types |
flat-tables |
flat catalog configuration |
cron-backlog |
pending or stuck cron jobs |
config |
suboptimal system configuration settings |
queries |
slow query patterns |
diagnose-performance check="all"
The response carries a _skill_hint to development-context category=performance, so the agent loads the performance guidelines before it starts changing things.
system-status for the raw state
diagnose-performance gives verdicts. When You want the actual state behind them, use system-status:
| Parameter | Default | Description |
|---|---|---|
check |
required | cache, indexers, deploy-mode, cron, cron-history |
group |
"" |
filter cron jobs by group |
jobCode |
"" |
filter cron history by job code |
limit |
50 |
max cron history records |
It returns a _hint too: an invalid indexer points to log for related errors, a disabled cache type comes with a warning about its impact.
Workflow
Let’s assume category pages got slow after a deploy.
- Run everything, read only
criticalandwarningfirst:
diagnose-performance check="all"
- Indexer finding? Look at the state and the related errors:
system-status check="indexers"
log action="analyze" hours=24
- Cron backlog? See which job is piling up:
system-status check="cron-history" jobCode="indexer_reindex_all_invalid" limit=20
- Fix, then run the same check again to confirm the finding is gone, e.g.
diagnose-performance check="indexes"
Apply fixes with the usual CLI (bin/magento indexer:reindex, cache:enable…). These tools inspect, they do not change Your configuration.
- Works in production deploy mode too, it is read-only
- Nothing found? Then it is time for a real profiler. At least now You know it is not the boring stuff
Start coding!
Source: GitHub · Diagnostics wiki