Alex Rivera | Logout

Check the open FD limit for a given process in Linux

Asked 2009-08-31T09:39:02.260
69

I recently had a Linux process which “leaked” file descriptors: It opened them and didn't properly close some of them.

If I had monitored this, I could tell – in advance – that the process was reaching its limit.

Is there a nice, Bash or Python way to check the FD usage ratio for a given process in a Ubuntu Linux system?

EDIT:

I now know how to check how many open file descriptors are there; I only need to know how many file descriptors are allowed for a process. Some systems (like Amazon EC2) don't have the /proc/pid/limits file.

Edit
Report

1 Answer

2

You can try to write script which periodically call lsof -p {PID} on given pid.

answered 2009-08-31T09:41:28.557

Your Answer