Hi,
We are running cloud hosting and installed Magento 2.4 with PHP 7.4. Everything seems very slow. The PHP memory limit for version 7.4 is currently set to 812Mb. Should we increase the PHP memory limit for Magento 2.4?
It may or may not help depending if the slowness if related to the lack of PHP memory.
Is the server properly optimized for Magento?
Are you using a Full Page Cache (FPC) like LiteMage Cache or Varnish Cache and also Redis Cache?
Validate
@ReginaNickles wrote:Hi,
We are running cloud hosting and installed Magento 2.4 with PHP 7.4. Everything seems very slow. The PHP memory limit for version 7.4 is currently set to 812Mb. Should we increase the PHP memory limit for Magento 2.4?
phpunit take large memory
setting higher Ram
php 7.4 leak memory, don't increase memory
Yes, increasing the PHP memory limit can potentially improve performance for Magento 2.4 running on PHP 7.4.
The default memory limit of 812MB is on the lower side for Magento 2. The recommended memory limit for Magento versions 2.3 and higher is 2GB or more.
Some things you can try:
- Set php.ini memory_limit to 2GB or higher (e.g. memory_limit = 2048M)
- If unable to edit php.ini, use ini_set('memory_limit','2048M') in index.php
- Increase cache memory allocation in php.ini for better caching
- Enable Redis or Varnish cache for reducing memory needs
- Make sure your cloud hosting plan has enough RAM allocated
- Enable PHP 7.4 Zend OPcache for faster PHP execution
- Optimize images, filesizes, plugins, theme, and code performance
Monitor memory usage to find the optimal memory limit. Too high may actually reduce performance in some cases. But increasing from the default 812MB will likely help Magento 2.4 load pages and process requests faster.