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>

1 Reply

Hey there,

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!

Sincerely,
Tara T
Linode Support Team

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct