Skip to content

Instantly share code, notes, and snippets.

@jason-idk
Created February 1, 2018 19:29
Show Gist options
  • Save jason-idk/04fb09ef9d6de78cc699f5dd93878a4d to your computer and use it in GitHub Desktop.
Save jason-idk/04fb09ef9d6de78cc699f5dd93878a4d to your computer and use it in GitHub Desktop.
Good starting point to begin calculating max clients for apache... Or just finding the average amount of memory used by a process.
### Calculate the average apache process memory size… ###
ps --no-headers -o "rss,cmd" -C httpd | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
Example with output:
# ps --no-headers -o "rss,cmd" -C apache2 | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
10M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment