Linux: monitor memory used for network buffers

/proc/net/sockstat has mem value, Is it memory used for network buffers?
Is it KB or MB?

 
$ cat /proc/net/sockstat 
sockets: used 8278
TCP: inuse 1090 orphan 2 tw 18 alloc 1380 mem 851
UDP: inuse 6574
RAW: inuse 1
FRAG: inuse 0 memory 0

or any other command to montior network buffer usage?

Hi,

If I understand correctly the linux source I just read, the FRAG mem parameter (memory used at the for the IP fragments re-assembly) is in bytes. I need to check for the other mem parameters, but I would expect to be in bytes too.

Cheers,
Lo�c.

Byte is way too small, There is no reason 1090 connections only use 851 byte.
The system has following buffer parameter in byte per connection.

net.ipv4.tcp_rmem = 4096        87380   174760
net.ipv4.tcp_wmem = 4096        16384   131072

Hi Honglus,

unless I am mistaken, it seems that the mem parameters for TCP and UDP is the number of kernel pages allocated. However, the memory parameter of FRAG seems to be the memory allocated bytes for fragmentation re-assembly...

"Very intuitive, and well documented" indeed. (use sarcastic tone)

Cheers,
Lo�c.