I wrote a simple UDP Server with Netty that simply prints out in logs the messages (frames) received. To do that, I created a simple frame decoder decoder and a simple message h
You have not properly configured the ConnectionlessBootstrap instance.
You have to configure followings with optimum values.
SO_SNDBUF size, SO_RCVBUF size and a ReceiveBufferSizePredictorFactory
lBootstrap.setOption("sendBufferSize", 1048576);
lBootstrap.setOption("receiveBufferSize", 1048576);
lBootstrap.setOption("receiveBufferSizePredictorFactory",
new AdaptiveReceiveBufferSizePredictorFactory(MIN_SIZE, INITIAL_SIZE, MAX_SIZE));
check DefaultNioDatagramChannelConfig class for more details.
The pipeline is doing everything using the Netty work thread. If worker thread is overloaded, it will delay the selector event loop execution and there will be a bottleneck in reading/writing the channel. You have to add a execution handler as following in the pipeline. It will free the worker thread to do its own work.
ChannelPipeline lChannelPipeline = Channels.pipeline();
lChannelPipeline.addFirst("execution-handler", new ExecutionHandler(
new OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576));
//add rest of the handlers here