phpmemory-limit

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


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?


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.