I've a VPS and about 100 headless device connected to VPS througth ssh inverse connection.
In the last days, the VPS reject ssh connections few minutes after reboot it with this message kex_exchange_identification: read: Connection reset by peer
.
If I'm connected to VPS with debug ssh flag sometimes I saw debug1: client_input_channel_req: channel 0 rtype keepalive@openssh.com reply 1
.
I readed about it and seems the error is caused by reaching the maximum number of sockets allowed.
With ss -xa | wc -l
:
494
But 430
are like follows and I don't know what service open this sockets:
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
u_dgr ESTAB 0 0 * 2147483647 * 0
With cat /proc/user_beancounters
:
Version: 2.5
uid resource held maxheld barrier limit failcnt
103848: kmemsize 66312098 68554752 9223372036854775807 9223372036854775807 0
lockedpages 0 503 262144 262144 0
privvmpages 369146 386161 9223372036854775807 9223372036854775807 0
shmpages 74623 74943 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
numproc 357 393 9223372036854775807 9223372036854775807 0
physpages 146470 154269 0 262144 0
vmguarpages 0 0 294912 9223372036854775807 0
oomguarpages 99708 106874 262144 9223372036854775807 0
numtcpsock 338 339 9223372036854775807 9223372036854775807 0
numflock 59 64 9223372036854775807 9223372036854775807 0
numpty 2 4 9223372036854775807 9223372036854775807 0
numsiginfo 0 24 9223372036854775807 9223372036854775807 0
tcpsndbuf 7093000 7110440 9223372036854775807 9223372036854775807 0
tcprcvbuf 5766768 5783152 9223372036854775807 9223372036854775807 0
othersockbuf 523272 871456 9223372036854775807 9223372036854775807 0
dgramrcvbuf 0 30520 9223372036854775807 9223372036854775807 0
numothersock 500 500 500 500 8621
dcachesize 26527977 26991757 9223372036854775807 9223372036854775807 0
numfile 6064 6290 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
numiptent 30 30 9223372036854775807 9223372036854775807 0
How can I know what service is opening so many sockets?