Skip to content

Instantly share code, notes, and snippets.

@KrustyHack
Created November 17, 2014 15:46
Show Gist options
  • Save KrustyHack/f3f5dd3b805143be9953 to your computer and use it in GitHub Desktop.
Save KrustyHack/f3f5dd3b805143be9953 to your computer and use it in GitHub Desktop.
List Couchdb processes, sort by memory and display Docker name
#!/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