[erlang-questions] Mnesia could not write core file: system_limit
Wed Dec 9 16:06:40 CET 2009
Slobodan Miskovic wrote:
> How would I check the FD usage of a running system?
Quick way to check on linux is to count the number of entries in
/proc/<PID>/fd (excluding . and .. of course). The command "lsof -p
<PID>" will also show you (although it lists a bunch of other things too
and I can't remember off the top of my head how to filter just to file
descriptors that contribute to the processes limit).
> Is there a way to get notified if node is approaching the limit, in which case I could take some corrective action (such as restarting the node).
I'll leave that as an exercise for the reader ;) (Although an erlang
process which periodically monitors it seems like it would be simple
enough to implement).
> Do open FDs get closed if a process dies? Perhaps that's where the leak is coming from.
In general, yes they do. However be aware that many operations in
Erlang spawn a process, and they're not always cleaned up in the way you
might expect (we found a particular case with long-lasting HTTP client
connections where you have to explicitly shut them down, even if the
process that initiated it had crashed). Basically, what you need to be
concerned about is process leaks, not FD leaks per se.
More information about the erlang-questions