Mike Perham

On Ruby, software and the Internet

Ruby Open Files

March 19th, 2010 · No Comments

Get the number of open files for each of your Ruby processes:

sudo lsof | grep ruby | ruby -e 'h=Hash.new(0);$<.each_line {|line| h[line.split[1]] += 1};p h'

Example output:

{"3268"=>808, "4513"=>399, "4795"=>237, "5067"=>178, "5083"=>16, "23751"=>108}

Tags: Ruby

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment