Skip to content

Instantly share code, notes, and snippets.

@flannon
Last active October 24, 2017 14:23
Show Gist options
  • Save flannon/eeccd552e34ef846e569bb361decafc6 to your computer and use it in GitHub Desktop.
Save flannon/eeccd552e34ef846e569bb361decafc6 to your computer and use it in GitHub Desktop.
list compiled modules
$ httpd -l
Estimate memory usage per apache process
$ ps -lyC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
The max value for MaxClients/MaxServers should be set to 80% of memory consumption
(i.e. mem per httpd process divided by 80% system memory.)
Or, for another version from https://gist.github.com/tbjers/4496984 with slight modifications, try this,
ps -ylC httpd --sort:rss | awk '{ s += $8; } END { print "Average Size:", s/(NR-1)/1024, "MB,\nProcesses: ", NR-1, "\nTotal usage: ", (s/(NR-1)/1024)*(NR-1), "MB, \nMax Servers: ", 6500/(s/(NR-1)/1024) }'
List open files for apache
sudo lsof | grep apache | grep <mount point file pattern>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment