Last active
November 13, 2015 09:34
-
-
Save AbhishekGhosh/01b935bc71200badd89f to your computer and use it in GitHub Desktop.
PHP5-FPM Average Process Memory Calculation
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
#!/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