I run a node_exporter on my server and node_exporter shows that there are over 5K TCP_alloc on the server. After rebooting the server, the count of TCP_alloc is still over 5K.
There are only a few lines when I run the command netstat -anltup
. Is it the correct ways to list the TCP_alloc? How to list all the TCP_alloc and reduce this value down?
Asked
Active
Viewed 382 times
0

Hank Chow
- 111
- 2
1 Answers
1
#!/bin/bash
for i in /proc/* ;
do
if [ -d $i/fd ];then
echo $i $(ls $i/fd -l | grep socket: |wc -l)
fi
done
To find out all the TCP connections of each process. It's OK now.

Hank Chow
- 111
- 2