Download the PHP package maritos/magento2-performance-fixes without Composer
On this page you can find all versions of the php package maritos/magento2-performance-fixes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maritos/magento2-performance-fixes
More information about maritos/magento2-performance-fixes
Files in maritos/magento2-performance-fixes
Package magento2-performance-fixes
Short Description Magento 2 performance fixes.
License MIT
Informations about the package magento2-performance-fixes
magento2-performance-fixes
Performance fixes for magento 2 core.
Problem and solution's concept - briefly
PHP / Magento doesn't support concurency requests. When Magento is handling numbers of requests at the same time (e.g. some headless frontend sent 10 requests at the same time on page load to ask graphql api for data) then each request got information to start building a cache. If cache exists - everything works perfectly but if it doesn't then first request starts building the cache and each next request do the same too.
It's not hard to imagine situation that when some process is slow and takes for instance 2s then every request will try build a cache until building process has been completed by one of requests. It is leading to situation when N requests are doing the same thing and every new request make process slower and slower the process which started before. Finally when we are talking about high traffic websites it's cause redis crash / high and long disk/cpu usage etc.
IMPORTANT: Testing just one request (without high concurrency) you likly won't achive any speed improvments.
Requirements
One dependancy: cweagans/composer-patches
Compatibility
This solution provides 3 file changes in core:
-
1 - magento/framework/Config/Data.patch - 2.3.0+
-
2 - magento/framework/App/ObjectManager/ConfigLoader.patch - 2.2.0+
-
3 - magento/framework/Interception/Config/Config.patch - 2.2.0+
Instalation
For this fixes I have chosen fix by vendor's patch. According Magento 2 documentation here: https://devdocs.magento.com/guides/v2.4/comp-mgr/patching/composer.html
- Step one
install package by composer:
composer require maritos/magento2-performance-fixes
-
Extend composer.json
- composer install
After composer install
make sure patches has been applied. Composer install output should similar to:
Contributing
Happy to hear your suggestions :)
Testing this solution
Please give me feedback via linkedin https://www.linkedin.com/in/mariusz-lopuch/ what improvment you achived. I will really appriciate it!
Thanks!