Multi-threaded Handling of UDP Messages

Trustin Lee (이희승) trustin at gmail.com
Thu Sep 17 22:48:49 EDT 2009


Hi Simon,

You are right - Netty uses only one thread for one channel.  Do you
know if multi-threaded selector loop that handles one UDP channel
improves throughput / latency?  To be honest, I've never such
configuration.  For TCP, I didn't see improvement in performance.

Thanks

— Trustin Lee, http://gleamynode.net/

On Wed, Sep 16, 2009 at 5:05 PM, Simon James <sjames at btisystems.com> wrote:
>
> Hi
>
> I apologize if this is a dumb question!
>
> I’ve implemented a simple UDP server along the lines of the QOTM example,
> but using NioDatagramChannelFactory rather than OioDatagramChannelFactory,
> namely:
>
>        DatagramChannelFactory factory =
>            new NioDatagramChannelFactory(Executors.newCachedThreadPool(),
> 10);
>
>        ConnectionlessBootstrap bootstrap = new
> ConnectionlessBootstrap(factory);
>        ChannelPipeline p = bootstrap .getPipeline();
>        // decoder/encoder omitted for clarity...
>        p.addLast("handler", new ServerHandler());
>
>        bootstrap .bind(new InetSocketAddress(1234));
>
> This works OK, except that there is no multi-threading : all incoming
> messages get handled by the same worker thread.
> Using ConnectionLessBootstrap, is there a simple way to make it use multiple
> threads in parallel?
>
> Thanks
>
> Simon
>
> --
> View this message in context: http://n2.nabble.com/Multi-threaded-Handling-of-UDP-Messages-tp3654751p3654751.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>



More information about the netty-users mailing list