How do I monitor the number of files descriptors opened by a process in RHEL?
Environment
Red Hat Enterprise Linux (RHEL) 2.1, 3, 4, 5, 6
Issue
- How do I monitor the number of files descriptors opened by a process?
Resolution
You can monitor the current usage of files descriptors of a process using lsof against the process PID. For example:
# lsof -p 1234
If your process got "Too many files open" error (For more detail: https://access.redhat.com/kb/docs/DOC-2471) and you want to keep monitoring the number of files descriptors it opened, you can write a script/cronjob to capture the lsof result repeatedly and monitor the file descriptors usage of the process.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
