Home > Other > WebFaction Memory Usage Script

WebFaction Memory Usage Script

I have knocked up a simple Ruby script (my first – please be gentle) to parse the output of ps -u -o pid,rss,command and convert the KB values to MB for easier reading.

The script recurses through each process and displays the process ID, memory usage (in megabytes) and the command that it’s executing. It then displays the total memory usage at the end.

Download
memusage.rb (1.21 kB — RB file)

Categories: Other Tags: ,
  1. November 3rd, 2010 at 00:15 | #1

    Thanks! I wanted to let you know that I adapted your script to automatically attempt to pull the username from the pwd. I’m not really much of a ruby-naut yet but my version is here:

    http://gist.github.com/660573

  1. No trackbacks yet.