Magento 2.2 often extremely slow, 100% processor usage after setup:upgrade
TL;DR: Just switch on the config caches.
Longer story:
I've had the same issue and have been playing around a bit.
Steps to reproduce (in developer mode):
- cache:disable
- setup:upgrade
- reload frontend or backend in a browser
When reloading and monitoring with htop, the system 'spams' some PHP processes, totally utilizing all CPUs. This is when I realized that it must depend on some cache settings. And I started to switch off some of them. After switching off the config caches, the problem re-appeared instantly.
After switching off every cache except the config cache, everything runs fast again.
If you updated using composer then it's likely that you cache is disabled. This applies to versions up to 2.3.1. Simply enable it by using the following code in the Magento root folder.
php bin/magento cache:enable