title: Check the open FD limit for a given process in Linux
body: <p>I recently had a Linux process which “leaked” file descriptors: It opened them and didn't properly close some of them.</p>
  <p>If I had monitored this, I could tell – in advance – that the process was reaching its limit.</p>
  <p>Is there a nice, Bash or Python way to check the FD usage ratio for a given process in a Ubuntu Linux system?</p>
  <p><strong>EDIT:</strong></p>
  <p>I now know how to check how many open file descriptors are there; I only need to know <strong>how many file descriptors are allowed for a process</strong>. Some systems (like Amazon EC2) don't have the <code>/proc/pid/limits</code> file.</p>