Linux – How to monitor current output/receive queue length in Linux

linuxnetwork-monitoringperformance-monitoringqueue

I want to check the capacity and performance of my network. Besides checking the txkB/s and rxkB/s via Sar, I'd also like to see the average queue length of the network interface(so that the average queueing time in the interface can be calculated). It seems that netstat can give a per socket queue length, is it possible to get a per interface statics(a bit like Network Interface\Output Queue Length in Windows)?

A related and kind of reverse questions is How do I view the TCP Send and Receive Queue sizes on Windows?

Thanks

Best Answer

It is available in IF-MIB. I'm assuming you already have an snmpd running that supports IF-MIB, if not you'll need to install something like net-snmp. After that walk the box and look for:

http://www.oidview.com/mibs/0/IF-MIB.html

IF-MIB::ifOutErrors.4 = Counter32: 0
IF-MIB::ifOutQLen.1 = Gauge32: 0

From the MIB definition:

The length of the output packet queue (in packets).