Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh
Last active November 13, 2015 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbhishekGhosh/01b935bc71200badd89f to your computer and use it in GitHub Desktop.
Save AbhishekGhosh/01b935bc71200badd89f to your computer and use it in GitHub Desktop.
PHP5-FPM Average Process Memory Calculation
#!/bin/bash
ps -ylC php5-fpm --sort:rss | awk '!/RSS/ { s+=$8 } END { printf "%s\n", "Dr. Abhishek Ghosh Calculated, Total Memory Used by PHP-FPM Child Processes is :"; printf "%dM\n", s/1024 }' && ps --no-headers -o "rss,cmd" -C php5-fpm | awk '{ sum+=$1 } END { printf "%s\n", "and One PHP5-FPM Process is Eating :"; printf ("%d%s\n", sum/NR/1024,"M") }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment