maritos/magento2-performance-fixes
Composer 安装命令:
composer require maritos/magento2-performance-fixes
包简介
Magento 2 performance fixes.
README 文档
README
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
"extra": {
"enable-patching": true,
"magento-force": "override",
"composer-exit-on-patch-failure": true,
"patches": {
"magento/framework": {
"performance fix #1 - vendor/magento/framework/Config/Data.php": "vendor/maritos/magento2-performance-fixes/vendorPatch/magento/framework/Config/Data.patch",
"performance fix #2 - vendor/magento/framework/App/ObjectManager/ConfigLoader.patch": "vendor/maritos/magento2-performance-fixes/vendorPatch/magento/framework/App/ObjectManager/ConfigLoader.patch",
"performance fix #3 - vendor/magento/framework/Interception/Config/Config.patch": "vendor/maritos/magento2-performance-fixes/vendorPatch/magento/framework/Interception/Config/Config.patch"
}
}
}
- composer install
After composer install make sure patches has been applied. Composer install output should similar to:
- Applying patches for magento/framework
vendor/maritos/magento2-performance-fixes/vendorPatch/magento/framework/Config/Data.patch (performance fix #1 - vendor/magento/framework/Config/Data.php)
vendor/maritos/magento2-performance-fixes/vendorPatch/magento/framework/App/ObjectManager/ConfigLoader.patch (performance fix #2 - vendor/magento/framework/App/ObjectManager/ConfigLoader.patch)
vendorPatch/magento/framework/Interception/Config/Config-2.4.x.patch (performance fix #3 - vendor/magento/framework/Interception/Config/Config.patch)
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!
maritos/magento2-performance-fixes 适用场景与选型建议
maritos/magento2-performance-fixes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22k 次下载、GitHub Stars 达 63, 最近一次更新时间为 2021 年 07 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 maritos/magento2-performance-fixes 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 maritos/magento2-performance-fixes 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 63
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-08