Fix Library: Performance and caching
Magento Admin Slow After Upgrade
Last updated:
What you see
Since the upgrade, saving a product or opening the orders grid takes many seconds, or times out.
Quick answer
After an upgrade the admin is most often slow because the store is not in production mode, indexers are set to update on save, or cron stopped running and the indexer backlog keeps growing. Check those three first. Slow extensions and missing OPcache settings come next.
What usually causes it?
- Developer or default mode instead of production mode
- Indexers on "Update on Save", so every save reindexes
- Cron not running, so scheduled indexing falls behind
- OPcache disabled or too small for the new code base
- An extension that runs heavy code on every admin save
How do you check it safely?
These checks only read information. Run them on staging first if you can, from the Magento root folder as the file system owner. Hosting setups differ, so paths and service names may need adjusting.
- Check the deploy mode.
bin/magento deploy:mode:show - Check indexer modes and status.
bin/magento indexer:show-mode bin/magento indexer:status - Check that cron ran in the last few minutes.
SELECT job_code, status, executed_at FROM cron_schedule ORDER BY executed_at DESC LIMIT 10; - Check OPcache for the PHP version the web server uses (from a phpinfo page or your host panel, not only the command line).
How do you fix it?
These steps change your store. Run them on staging first, with a backup of code and database.
- Switch to production mode on staging first. It compiles code and deploys static files.
bin/magento deploy:mode:set production - Set indexers to update by schedule, so saves stay fast and cron does the indexing.
bin/magento indexer:set-mode schedule - Fix cron if it is not running (see the cron fix page).
- Enable OPcache with enough memory for Magento, through your host.
- Profile a slow save to find extensions that do heavy work, then fix or remove them.
When should you call an expert?
Call an expert if the admin is still slow in production mode with schedule indexing and working cron, or if saves time out.
Need it fixed today?
I can look at it with you. Book a 20 minute call, or if the store is down, see emergency Magento support.
FAQ
Common questions.
Is it safe to switch indexers to "Update by Schedule"?
Yes, it is what Adobe recommends for production. It needs cron to run, so check that first.
Why did the upgrade change the mode?
Upgrades are often run in developer or default mode and never switched back. Production mode has to be set on purpose.
Related
Rather have it fixed for you?
Send a few lines about the problem, or book a 20 minute call. You get an honest read and a fixed quote.