wtorek, 15 stycznia 2013

Linux: UDP buffer monitoring utility (udpstat)

Udp statistics tool

The goals

The goal for this utility was to:

1. Present /proc/net/udp in human readable form:
- timestamp
- local address - from hex to dot notated (in case of IPv6 in hex) + port
- remote address - from hex to dot notated (in case of IPv6 in hex) + port
- rx, tx queue - in bytes, kbytes, mbytes (constrolled by parameter)
- drops

2. Constant monitoring with configurable interval polling:
- statistics presented every n seconds
- monitor interval controlled by command line parameter
- number of polls controlled by command line interface

3. Print Per pid statistics - present udp statistics per pid (/proc//net/udp)

4. Print kernel configuration parameters: max size + utilization of the buffer (rx queue / rx max size & tx queue / tx max size)

Where it can be downloaded from?

It has become a part of the yapcg project. The latest version available here: http://code.google.com/p/yapcg/source/browse/measurements/perftools/udpstat should meet all the goals . You can give it a try - what you will need is ruby 1.9.3 with optparse, ostruct gems (should be available in standard installation, at least these was the case on my Ubuntu 12.10 box)

The syntax of the utility is:


$ udpstat
Usage: udpstat [options]

Specific options:
    -6, --ipv6                       Enable IPv6 stat parsing
    -K, --kilobytes                  Present values in kilobytes
    -M, --megabytes                  Present values in megabytes
    -p, --ppid pid                   PID of the process to be monitored

Common options:
    -h, --help                       Show this message
    -v, --version                    Show version

    - interval in which statistics are to be reported
       - the number of statistics to be shown

@2013 Krystian Brachmanski, Wroclaw


As previously mentioned it has been verified on Ubuntu 12.10 64-bit OS, running 3.5.0-21-generic kernel and ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux].

How to use it?

I always say that I learn the most on examples therefore I recommend to check another article on my blog to see how you can truoubleshoot a simulated udp buffer problem in the application.

Brak komentarzy:

Prześlij komentarz