Memory limit setting for higher RAM

My Setup

Dedicated Server
I setup the server with developer
CentOS 7.8.2003, Apache 2.4.46, PHP 7.4.10
Magento 2.4

Memory limit setting question

php.ini find “memory_limit” and replace “128M” with an appropriate value. Because this is a 4GB Server, I’ll set this to “4G”.

If my server has 16GB ram, do I have to set ‘16G’?

nano .htaccess - memory_limit - Replace 756MB with 2G.

Also, do I have to set 16G?

  1. If I run 5 x M 2.4 stores on my server, what memory_limit should I set for each .htaccess stores?

Curious the reason too.

I could install M 2.4, thanks to you. Love your contents! :slight_smile:

Hi @Yohan and welcome,

  1. Assuming each Magento instance caps out their memory allocation of 4GB, then you might want your php.ini file to be set at 20GB. But that’s probably worst case scenario. Experiment and tweak where necessary. So, I guess just start with the full 16GB.
  2. I haven’t really seen any performance gains after setting php_memory limit greater than 4GB per installation (.htaccess)
  3. As above

Having said all of that, tweaking Web Server Configuration Variables is never a “set and forget” exercise. Ideally, performance should be monitored and tweaked accordingly. So, your mileage may vary compared to my experiences.

Thanks Craig! :smile: I will set as you guide. I agree I should monitor and tweak the performance

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.