This video goes over optimizing apache memory usage by configuring mpm prefork module to optimal values for your server.
UPDATE: Run this curl command and it will just tell you what you should put
curl -sL https://raw.githubusercontent.com/richardforth/apache2buddy/master/apache2buddy.pl | perl
Commands used:
Check Apache Memory usage
ps -ylC apache2 –sort:rss | awk ‘{sum+=$8; ++n} END {print “Tot=”sum”(“n”)”;print “Avg=”sum”/”n”=”sum/n/1024″MB”}’
Launch Memory manager / resource viewer
‘htop’ OR you can use ‘top’ for less options and visuals
Values to calculate:
Total System Memory Free – Buffer / Apache2 MB usage = MaxRequestWorkers, ServerLimit, and MaxClients
My Settings in Video: Server Instance (Standard) 1 dedicated vCPU with 3.5 GB of Memory
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of requests a server process serves
StartServers 3
MinSpareServers 5
MaxSpareServers 10
ServerLimit 45
MaxClients 45
MaxRequestWorkers 45
MaxConnectionsPerChild 2000
45 processes x 68 MB per = 3060 MB .
►► Digital Downloads ➜ https://www.cttstore.com
►► Patreon ➜ https://www.patreon.com/christitustech
►► Twitch ➜ https://www.twitch.tv/christitustech
►► Website and Guides ➜ https://christitus.com

Hello, I have restarts when it reaches more than 5GB of RAM usage. I have a server with 12 cores and 47GB of RAM. What would be the optimal configuration for MPM Prefork?thanks
hey there i have 2vcpus and 1Gb what do you suggest?
Why can't I find apache2 folder in the folder etc? Is it because I don't install LAMP in my f-1 micro VM?
MPM Event it best !!
Please try to use bigger fonts it sucks when watching your video on phone
I need to know apache server optimization for large scale application where worker threads are working. So that willl be helpful for us.
Thanks
Hi..great video..very helpful..keep it up.THanks..anyway do you know where to edit this using Dockerfile?or where to place the configurations inside docker? we are using WordPress in Azure.THanks
How would I apply optimizing to CentOS 7 ?
Chris, you said you would do a video no optimizing Apache modules for minimum memory usage. Not sure you released it yet?
Dude , you dialed back from this , I guess to reach a larger audience but a technical video like this is great to see. I started watching you regular after 'Drunk Arch Install' so I never saw this. The audience you have now wouldn't be with this , like you said your doing entry level pushing for the adoption of linux. Personally I think you should start doing some videos like this one for more advanced/technical users every once and a while.
Thanks for the video. Any way how to know which module is actively in use by apache, so that rest of them can be disabled ?
Does it makes any difference if one have workers module on micro instance running instead of prefork?
Thx very usefull