Friday, February 1, 2013

Socket Stats

A bunch better tool than can even show you memory usage for all your sockets:

What do all these memory letters represent?

Recv-Q Send-Q       
   0      0            

You can do man netstat to understand what Recv-Q and Send-Q mean:

     The count of bytes not copied by the user program connected to this socket.

     The count of bytes not acknowledged by the remote host.

The rmem, wmem, fmem, and tmem refers to specific Linux kernel values:

rmem = sk->sk_rmem_alloc; 
wmem = sk->sk_wmem_queued; 
fmem = sk->sk_forward_alloc; 
tmem = sk->sk_wmem_alloc;

sk_forward_alloc is the forward allocated memory which is the total memory currently available in the socket’s quota.
sk_wmem_queued is the amount of memory used by the socket send buffer queued in the transmit queue and are either not yet sent out or not yet acknowledged.

For more information, see Chapter 9 of TCP/IP Architecture, Design and Implementation in Linux:

No comments:

Post a Comment