Created
April 18, 2013 12:20
-
-
Save elentok/5412315 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| # uses memstats.rb from https://gist.github.com/elentok/5412060 | |
| master_pid=`ps aux | grep 'unicorn master' | grep -v 'grep' | awk '{print $2}'` | |
| worker_pids=`ps aux | grep 'unicorn worker' | grep -v 'grep' | awk '{print $2}'` | |
| stats() { | |
| ./memstats.rb $1 | grep -E '(rss|percentage)' | |
| } | |
| echo "MASTER:" | |
| stats $master_pid | |
| echo "WORKERS:" | |
| for pid in $worker_pids; do | |
| stats $pid | |
| done | |
| ~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment