Netty – EventLoop Queue Monitoring

Netty does not have any logging for that purpose but I implemented a way to find pending tasks and put some logs according to your question. here is a sample log from my local netty spring logging

you can find all code here

About code which is very explanatory from itself but NettyConfigure is actually doing the netty configuration in spring boot env. at you can see “how many pending tasks” in the queue. DiscardServerHandler may help you how to discard if the limit is full. You can use jmeter for the test here is the jmeter file

if you want to handle netty limit you can do it like the code below

public void channelActive(ChannelHandlerContext ctx) throws Exception {
    if ( == false) { // means we hit the max limit of netty
        System.out.println("I suggest we should restart or put a new server to our pool :)");

You should check for handling the limits and here is another explanation about “isWritable”

One more extra, I put actuators in the place http://localhost:8080/actuator/metrics/http.server.requests is nice to check too.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top