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.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Debug for "Too many open files"
Re: Debug for "Too many open files"
And the search query you used before you posted is... what exactly?
I got some great results using tcp socket "too many files"
I got some great results using tcp socket "too many files"
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: Debug for "Too many open files"
You can try this:
For system wide limits
'ulimit'
Is a useful command
--Try :
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/libp ... .5.en.html
Code: Select all
cat /proc/sys/fs/file-max
'ulimit'
Is a useful command
Code: Select all
man ulimit
Code: Select all
ulimit -n
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/libp ... .5.en.html
"What we expect you have already Done"
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
==========
Old Website
======================
For the Birds
==================
What Does a Parrot Know About PTSD?
-
- Posts: 45
- Joined: 2012-04-13 03:44
Re: Debug for "Too many open files"
Thanks all responses. It is Debian 8 Jessie, Sorry for not clear here, my intention is to debug a C++ program socket library which I suspect it might not close the socket properly. I need to run command to check how many socket descriptor files have been opened while I am running a test program to start the socket application and close it in a loop until it crashes the machine by error "Too many open files". So I am looking for the command line to display how many socket descriptor files are opened. I figured out that the lsof is the right command.GarryRicketson wrote:You can try this:For system wide limitsCode: Select all
cat /proc/sys/fs/file-max
'ulimit'
Is a useful command--Try :Code: Select all
man ulimit
There is a file : 'limits.cnf' in /etc/security/Code: Select all
ulimit -n
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/libp ... .5.en.html
Thank you.
Re: Debug for "Too many open files"
Is this a school project?
Have you mixed anything with your Jessie that does not belong? Added extra repositories? ppa's? Messed with something you shouldn't have?
Sorry for asking but this seems rather strange.
Have you mixed anything with your Jessie that does not belong? Added extra repositories? ppa's? Messed with something you shouldn't have?
Sorry for asking but this seems rather strange.
Re: Debug for "Too many open files"
You were perfectly clear. You wanted to count the number of open TCP sockets, not to identify a maximum limit. Unfortunately, poster clarity doesn't always guarantee on-topic responses.I am a nobody wrote:Sorry for not clear here...
As a pure question of economy of effort, I'd encourage you to focus on your own code first. (And if the socket library is your own code, then have at it.)I am a nobody wrote:my intention is to debug a C++ program socket library...
Purely pedantic point: abnormal termination of an application is not "crashing the machine" nor anywhere close to it.I am a nobody wrote:...start the socket application and close it in a loop until it crashes the machine
It's certainly a workable solution.I am a nobody wrote:I figured out that the lsof is the right command.
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 5 times
- Been thanked: 16 times
Re: Debug for "Too many open files"
You could simply open a terminal and type you could even put it in a loop to keep updating at an interval of your choosing.
Code: Select all
netstat -an | grep -i tcp | wc -l