Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh AbhishekGhosh/mem_php5.sh
Last active Nov 13, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.