Skip to content

Instantly share code, notes, and snippets.

@elentok
Created April 18, 2013 12:20
Show Gist options
  • Select an option

  • Save elentok/5412315 to your computer and use it in GitHub Desktop.

Select an option

Save elentok/5412315 to your computer and use it in GitHub Desktop.
#!/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