Angler is a utility for monitoring the performance of UDP and TCP message-processing in the Linux kernel.
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:
- socket queue (transmit & receive) depth
- socket drop count
- UDP queue errors
- UDP buffer overflows
- UDP checksum errors
- network events processed
- time squeeze events
- drop events
- 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.
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("127.0.0.1", 19889));
Executors.newSingleThreadScheduledExecutor().
scheduleAtFixedRate(() -> udpSocketMonitor.poll(loggingStatsHandler),
0L, 1L, TimeUnit.SECONDS)
Implement a handler for the socket statistics:
private static class LoggingUdpSocketStatisticsHandler implements UdpSocketStatisticsHandler
{
@Override
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
.
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.
- Report relevant TCP statistics
- Support IPv6 sockets
- 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