Server with 4GB RAM - amount of memory to set the memory_limit in PHP for this server? [duplicate]

StackOverflow https://stackoverflow.com/questions/23555668

  •  18-07-2023
  •  | 
  •  

Question

I have a dedicated cloud server with 4GB of RAM and 4 Cores 1.2GHz.

I have an extremely robust system running and would like to know the amount of memory to set the memory_limit in PHP 5.5?

Was it helpful?

Solution

Benchmark your specific application and go from there.

Without knowing what your application is or does it's really difficult to suggest a limit that would suit it. You may find giving other parts of your app server (os, httpd, db) more memory will give you a bigger performance boost than simply upping the limit PHP can use.

This particularly applies for databases, for many applications this is the bottleneck.

So either set it quite high, or turn the limit off entirely and look at benchmarking its use over periods of high (real or simulated) use and see then what you think it really needs, and add a 10-15% buffer on top of that.

No suggestion from any of us will beat actively monitoring its performance and adjusting as your application and users change.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top