Which processes are swapping?!

Recently one machine was swapping. No free space on the swap partition. Hmmm... Since this machine was used as a database server, obviously I suspected mysql. But why to guess when I could knew for sure which process was swapping...

[codesyntax lang="bash"]

for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less

[/codesyntax]

Wasn't mysql but collectd btw :)

Scrie si tu o vorbulita


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.