Re: [users@httpd] RE: Apache 2.4 worker mpm memory climbing no new processes

That makes a lot of sense. You explained that very well.


Reply-To: " ... at httpd dot" < ... at httpd dot>

This is from memory many years ago, so minor details might be off:

If you have requests that take different amounts of memory to handle, the larger requests will in turn bump up the memory used by a thread pool, while releasing that memory pack to the thread pool when the request finishes. Requests will keep pulling from the thread pools, so another large request on that same thread won’t bump up your usage. However, if you have something extreme, like a request that takes 10MB to process (and your other requests are processing in 1MB), you may very well bump up your overall memory consumption by around 9MB or so with that request. And if you then process another 10MB request on a different thread, that would bump it up by another 9MB. By the time you get the large request in all 75 threads, you would be using 750MB (250MB per child), and the thread related memory would stop growing.

If these large requests are very infrequent, and not something you can segregate out (to send to an HTTPD with fewer threads and overall lower transaction volume), you might want to consider more smaller thread workers and a limit to the number of requests a given worker will process, so that process would be recycled before all the threads hit that big response.

Rick Houser
Web Engineer


Apache 2.4
Worker MPM

I am using this configuration for Worker MPM:

<IfModule mpm_worker_module>
ServerLimit 90
StartServers 10
MaxRequestWorkers 2048
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25

Apache has created 12 processes. Apaches memory consumption slowly increases but never goes down. Currently Apache is using 423M and the average Process size is 35.3M. When I look at the Apache access log I see an enormous number of requests coming across my terminal. Should I change my settings? I am concerned that at some point I am going to run out of memory.

Since I started writing this email Apache is now up to 426M and the average process size is at 35.5M.