0

I'm using MPM - worker on Apache, I found a issue with this, httpd doesn't release memory when MPM is worker or event, it will make server out of memory.

 PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
10076 apache    20   0 2713460 557292   8380 S   0.0 14.6   0:12.20 httpd
10117 apache    20   0 2482100 447808   7992 S   0.0 11.7   0:10.36 httpd
10078 apache    20   0 2482100 447640   7980 S   0.0 11.7   0:10.54 httpd

Here is my httpd MPM config

ServerLimit               10
StartServers               3
ThreadsPerChild           25
MaxRequestWorkers        100
MinSpareThreads           50
MaxSpareThreads          100
MaxConnectionsPerChild   200

My environment is CentOS 7.8and Apache 2.4.46

Server version: Apache/2.4.46 (codeit)
Server built:   Aug  7 2020 15:21:08
Server's Module Magic Number: 20120211:93
Server loaded:  APR 1.7.0, APR-UTIL 1.6.1
Compiled using: APR 1.7.0, APR-UTIL 1.6.1
Architecture:   64-bit
Server MPM:     worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)

I've tried to use prefork, it works perfectly, but unfortunately prefork doesn't support http/2.

How to release the memory of httpd?

Do you have any idea?

Thank you.

  • Something is very wrong there. Apache should not be using such large amounts of memory in worker or event MPM. What other configuration have you made to it? – Michael Hampton Sep 16 at 14:59

Browse other questions tagged or ask your own question.