Querying Networking Statistics: dlstat(1M)

Posted by user12612042 on Oracle Blogs See other posts from Oracle Blogs or by user12612042
Published on Mon, 11 Nov 2013 00:28:37 +0000 Indexed on 2013/11/11 10:10 UTC
Read the original article Hit count: 645

Filed under:
Oracle Solaris 11 took another big leap forward in networking technologies providing a reliable, secure and scalable infrastructure to meet the growing needs of today's datacenter implementations. Oracle Solaris 11 introduced a new and powerful network stack architecture, also known as Project Crossbow.

From Solaris 11 onwards, we introduced a command line tool viz. dlstat(1M) to query network statistics. dlstat (for datalink statistics) is a statistics querying counterpart for dladm(1M) - the datalink administration tool.

The tool is very easy to get started. Just type dlstat on a shell prompt on Solaris 11 (or later). For example,:

# dlstat
LINK IPKTS RBYTES OPKTS OBYTES
net0 834.11K 145.91M 575.19K 104.24M
net1 7.87K 2.04M 0 0

In this example, the system has two datalinks net0 and net1. The output columns denote input packets/bytes as well as output packets/bytes. The numbers are abbreviated in xxx.xxUnit format. However, one could get the actual counts by simply running dlstat -u R (R for raw):

# dlstat -u R
LINK IPKTS RBYTES OPKTS OBYTES
net0 834271 145931244 575246 104242934
net1 7869 2036958 0 0

In addition, dlstat also supports various subcommands

dlstat help
The following subcommands are supported:
Stats : show-aggr show-ether show-link show-phys
show-bridge
For more info, run: dlstat help {default|}

I will only describe couple of interesting subcommands/options here. For a comprehensive description of all the dlstat subcommands refer dlstat's official manual .

For NICs that support multiple rings (e.g. ixgbe), dlstat show-phys -r allows us to query per Rx ring statistics. For example:

dlstat show-phys -r net4
LINK TYPE INDEX IPKTS RBYTES
net4 rx 0 0 0
net4 rx 1 0 0
net4 rx 2 0 0
net4 rx 3 0 0
net4 rx 4 0 0
net4 rx 5 0 0
net4 rx 6 0 0
net4 rx 7 0 0

In this case, net4 is just a vanity name for an ixgbe datalink. This view is especially useful if one wants to look at the network traffic spread across all the available rings. Furthermore, any of the dlstat commands could be run with -i option to periodically query and display stats. For example, running dlstat show-phys -r net4 -i 5 will emit per Rx ring stats every 5 seconds. This is especially useful while analyzing a live system. Similarly, dlstat show-phys -t could be used to query per Tx ring stats. -r and -t could also be combined as dlstat show-phys -rt to query both Rx as well as Tx stats at the same time.

Finally, there is also a quick way to dump ALL the stats. Just run dlstat -A. You probably want to redirect this output to a file because you are going to get a whole load of stats :-).

© Oracle Blogs or respective owner

Related posts about /Sun