Hi,
I need to check and fix "Too many open files" caused by bugs of TCP sockets were opened but not closed. What is the command line I can check how many socket file descriptors have been opened?
Thank you.
cat /proc/sys/fs/file-max
man ulimit
ulimit -n
GarryRicketson wrote:You can try this:
- Code: Select all
cat /proc/sys/fs/file-max
For system wide limits
'ulimit'
Is a useful command
- Code: Select all
man ulimit
--Try :
- Code: Select all
ulimit -n
There is a file : 'limits.cnf' in /etc/security/
that can be modified.
Since you do not mention what version of Debian you are using, the above might not apply, I am using Debian 7 wheezy, and it is a valid command.
The Debian wiki,is often a valuable resources ?
https://wiki.debian.org/Limits
Also :
https://manpages.debian.org/jessie/libpam-modules/limits.conf.5.en.html
I am a nobody wrote:Sorry for not clear here...
I am a nobody wrote:my intention is to debug a C++ program socket library...
I am a nobody wrote:...start the socket application and close it in a loop until it crashes the machine
I am a nobody wrote:I figured out that the lsof is the right command.
netstat -an | grep -i tcp | wc -l
Users browsing this forum: No registered users and 10 guests