Linux – How to read the number of pending requests in the TCP stack backlog under linux

kernellinuxtcp

I did set my kern.ipc.somaxconn kernel parameter to tweak the maximum backlog TCP size for incoming connections on my server.
I'm now looking to read the current amount of request pending in this backlog.

I thought for a moment it was the number of connection in the state 'ESTABLISED' in the ouput of netstat, but I understood that requests being processed by the application could also be in this state.

Is there a file I have to read in the /proc/ filesystem, is it an option of netstat that I missed?

Best Answer

If I understand the question correctly, I believe you're referring to the Recv-Q and Send-Q numbers from netstat.

If these numbers are not near zero, there is a high probability that there is either something going wrong with hardware, or that you are saturating your link.