How to know Apache process/thread size in MPM Event
In Ubuntu 16 with 8 GB of RAM with PHP FPM how to know calculate the average apache process and thread size so as to optimize the conf variables?
Using "free -m" it typically shows around 2GB free RAM
<IfModule mpm_event_module> StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 45 MaxRequestWorkers 200 MaxConnectionsPerChild 0 </IfModule>
Without knowing more about your use case, it's best we avoid providing hard number recommendations. This article provides a very thorough walkthrough of configuring PHP FPM with calculations specific to your resources and use case that we think would be helpful for you.
Here is a quick excerpt:
Now we can decide how many processes the server is allowed to spin up. Here's a generic formula:
Total Max Processes = (Total Ram - (Used Ram + Buffer)) / (Memory per php process)
This server is has about 3.5gb of ram. Let's say PHP uses about 30mb of ram per request.
We can start with: (1024*3.5) / 30 = 119.46. Let's just go with 100 max servers.
Note that I didn't take into account used ram and add in a buffer. That'd be need if the server did more, such as also hosted a database.
We hope that helps move your troubleshooting forward! Lt us know if this was helpful!
Linode Support Team