Optimizing Apache Memory Usage | Mpm prefork settings
Chris Titus Tech
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
💻 Recommendations 💻
- My Windows Anti-Virus ➜ https://links.christitus.com/webroot
- My VPN Service ➜ https://links.christitus.com/expressvpn
- Website Recommendations ➜ https://www.christitus.com/recommendations
🕹 Live Streams Monday & Friday 🕹
- Twitch ➜ https://www.twitch.tv/christitustech
- YouTube Archive ➜ https://www.youtube.com/c/ChrisTitusTechStreams
🖥 Contact me 🖥
- Patreon ➜ https://www.patreon.com/christitustech
- Official Site ➜ https://www.christitus.com
- Twitter ➜ https://twitter.com/christitustech
🚑 Need Help!? Ask our community! 🚑
- Discord ➜ https://www.christitus.com/discord
- Reddit ➜ https://www.reddit.com/r/ChrisTitusTech/
💰 My Amazon Store (YouTube Gear, PC Hardware, and Books I recommend) 💰
DISCLAIMER: This video and description contain affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This helps supports the channel and allows us to continue to make videos like this. Thank you for your support! ... https://www.youtube.com/watch?v=uGugeHVEeiU
89187198 Bytes