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

From: Campbell, Lance [mailto:la...@illinois.edu]
Sent: Tuesday, January 09, 2018 12:28
To: users@httpd.apache.org
Subject: [users@httpd] Apache 2.4 worker mpm memory climbing no new processes

EXTERNAL EMAIL


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
</IfModule>

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.

Thanks,

Lance

Reply via email to