too many sockets in use

hello
I started to get some ENOBUFS errors.

Code:
# vmstat -z | grep socket
socket:                   356,    12331,    12292,       39, 274334042,   112064

# netstat -n | wc -l
     621

any ideas on how to find out which process is using so many sockets?

thanks
 
You wanted to find out which process is using a lot of sockets? Then read the output, not pipe it through wc.
The difference in numbers is because sockstat also shows file sockets.
 
but, I mean, "socket" count is up to 12000+

from the look I gave on sockstat output, it's pretty ordinary (a few services using around 50~200 sockets), but nothing close to 1000+
 
Oh wait. Vmstat doesn't show the number of sockets in use. It shows the amount of socket memory (buffers) in use.
 
SirDice said:
Oh wait. Vmstat doesn't show the number of sockets in use. It shows the amount of socket memory (buffers) in use.

oh, that makes some sense
the problem stopped after I raised maxsockets

but what I don't get is, on another server:

Code:
# sockstat | wc -l
     486

# vmstat -z | grep socket
socket:                   416,    25605,      613,     3032, 201205440,        0

so, almost the same number of sockets on sockstat (486), but WAY less buffers in use (613 vs 12000)

any ideas on what may cause that?
maybe multiple quick connections/disconnections in a time less than enough to clean the buffers?
 
I'm definitely not versed enough in socket programming but I think those buffers are used for all sorts of socket data.
 
Back
Top