Slow reloading of configuration cache under Magento 2.3.1
jissereitsma opened this issue · 2 comments
Whenever the configuration cache is freshly loaded or whenever this cache type is refreshed, the DevTools causes the next page load to be dead-slow. I narrowed it down to the various calls upon the DevTools extension. In the source code, there are some (weird) constructs (singleton-like) to prevent loops. But it seems there is still something slow here. I just wanted to open the report for starters.
Preconditions
- Magento 2.3.1
- Configuration cache enabled
Steps to reproduce
- Disable the DevTools extension, clean the config cache, reload the page and measure the time
- Enable the DevTools extension, clean the config cache, reload the page and measure the time
In my own case, reloading the config cache without DevTools takes about 4 seconds. With DevTools enabled, it takes about 40-60 seconds.
I meant to dive into this earlier. This is not an issue in DevTools but a cache lock issue introduced by Magento 2.3.1. Within the Magento project, there is a PR magento/magento2#22829 that fixes this which should be part of 2.3.2 (hopefully). As a dirty workaround, you can open up the class \Magento\Config\App\Config\Type\System
and modify the private variable $lockTimeout
from 42
to 1
. This number seems to have been randomly chosen to be 42, just like that this issue within the MSP DevTools project also has number 42.
This is fixed anyway in Magento 2.3.2. Not with the fix suggested by me earlier, but they rewrote the whole architecture on cache locking. Last message here.