Answer the question
In order to leave comments, you need to log in
How to reduce the number of open descriptors that are displayed by the fs.file-nr parameter?
Actually a subject. I ask you to tell me how to find a process that has gobbled up an incredibly large number of open file descriptors? Maybe with the help of lsof, ps?
example from real life:
cat /proc/sys/fs/file-nr
5927920 0 6577798
Answer the question
In order to leave comments, you need to log in
Here, from memory, I quickly sprinkled it, crookedly, but you caught the essence, I think.
#!/bin/bash
for i in `ps aux --no-header | awk '{print $2}'` ;
do
echo `lsof -p $i | wc -l` " - " `lsof -p $i | awk '{print $1}'`
done
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question