Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time


Angler is a utility for monitoring the performance of UDP and TCP message-processing in the Linux kernel.

Build Status


Mark Price

What can it tell me?

Angler will notify registered listeners of buffer-depths, packet drops and receive errors of individual UDP and TCP sockets.

System-wide UDP receive metrics will also be supplied if requested.

Current metric sources are:


  1. socket queue (transmit & receive) depth
  2. socket drop count


  1. UDP queue errors
  2. UDP buffer overflows
  3. UDP checksum errors


  1. network events processed
  2. time squeeze events
  3. drop events


  1. socket queue (transmit & receive) depth

Monitoring these metrics can be useful when trying to track down the source of packet-loss in high-throughput traffic scenarios.

How do I use it?

The simplest use-case for Angler is to monitor socket queue depth and drop counts:

// begin monitoring
private final UdpSocketMonitor udpSocketMonitor = new UdpSocketMonitor(monitoringCallback);

udpSocketMonitor.beginMonitoringOf(new InetSocketAddress("", 19889));

        scheduleAtFixedRate(() -> udpSocketMonitor.poll(loggingStatsHandler),
                0L, 1L, TimeUnit.SECONDS)

Implement a handler for the socket statistics:

private static class LoggingUdpSocketStatisticsHandler implements UdpSocketStatisticsHandler
    public void onStatisticsUpdated(final InetAddress inetAddress, final int port,
                                    final long socketIdentifier, final long inode,
                                    final long transmitQueueDepth, final long receiveQueueDepth,
                                    final long drops)
        if(drops != 0)
            log("Socket [%s:%d], queued: %d, drops: %d",
                    inetAddress.toString(), port, receiveQueueDepth, drops);

The handler will be notified if the socket's queue-depths or drop-count changes between invocations of the poll method.

See the ExampleApplication for further details.

To test functionality, check out the project and run ./gradlew runExample.

Performance notes

Angler will not generate garbage once in a steady-state.

Adding and removing sockets from the monitored set will cause allocation. Large changes in the number of active UDP or TCP sockets on the system will cause one-time allocation of a larger read-buffer for datasources.

Road map

  • Report relevant TCP statistics
  • Support IPv6 sockets

Change log


  • Report TCP socket transmit and receive buffer depth
  • Upgrade to Agrona 0.5.3


  • Bugfixes to file handling routine
  • Report UDP socket transmit buffer depth


  • Bugfixes to file handling routines


  • Upgrade to Agrona 0.5.1


A utility for monitoring UDP message-processing




You can’t perform that action at this time.