Created
November 17, 2014 15:46
-
-
Save KrustyHack/f3f5dd3b805143be9953 to your computer and use it in GitHub Desktop.
List Couchdb processes, sort by memory and display Docker name
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 -eo pid,%mem,%cpu,user,args --sort -%mem | grep beam.smp | awk -F" " '{print $1}' | xargs -I {} cat /proc/{}/mountinfo | grep -Po "containers\/.{64}\/hostname" | awk -F"/" '{print $2}' | xargs -I {} docker inspect --format='{{.Name}}' {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment