Created
February 20, 2017 14:20
-
-
Save thebouv/2bdffc36de52fa6f5da1e200273f8be6 to your computer and use it in GitHub Desktop.
One line to get average mem used by running apache processes, great for estimating MaxClients
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}' | |
# above is a one liner, not really a script | |
# MaxClients = 80% of max memory on system / average mem from one-liner above |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment