Operating System - HP-UX
1753774 Members
7214 Online
108799 Solutions
New Discussion юеВ

total number of sockets used by system

 
SOLVED
Go to solution
Shivkumar
Super Advisor

total number of sockets used by system

What is the command to check total open sockets or opened files on entire server ? Actually, i want to check whether system is running lower on socket side.

Thanks,
Shiv
4 REPLIES 4
Sandman!
Honored Contributor

Re: total number of sockets used by system

It is controlled on a system-wide basis with the "nfile" kernel parameter and on a per process basis with the "maxfiles_lim" parameter. This is because a socket looks like a standard file You can view the values with the following commands:

# kmtune -q nfile

# kmtune -q maxfiles_lim

cheers!
Mel Burslan
Honored Contributor
Solution

Re: total number of sockets used by system

lsof -U | wc -l

or

socketsopen=(( `netstat -an|wc -l` - `netstat -an | grep -n "Active UNIX domain sockets"|cut -d: -f1` - 2 )); echo $socketsopen

they are not identical but very close numbers. I am not sure where their difference is coming from.

hope this helps
________________________________
UNIX because I majored in cryptology...
Mel Burslan
Honored Contributor

Re: total number of sockets used by system

sorry, I made a syntax erroron my previuos post, correct version of the netstat calculation will be as follows:

(( socketsopen=`netstat -an|wc -l` - `netstat -an | grep -n "Active UNIX domain sockets"|cut -d: -f1` - 2 )); echo $socketsopen
________________________________
UNIX because I majored in cryptology...
Sandman!
Honored Contributor

Re: total number of sockets used by system