Skip to content

Instantly share code, notes, and snippets.

@junaid18183
Created April 6, 2015 10:52
Show Gist options
  • Save junaid18183/1f8217383ed01b3b27c9 to your computer and use it in GitHub Desktop.
Save junaid18183/1f8217383ed01b3b27c9 to your computer and use it in GitHub Desktop.
Determine an average amount of memory consumed by one Apache process to define the MaxClients in prefork MPM
#Ubuntu
#ps -ylC apache2 | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
#centos
ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment