How many receiver threads can netty use for all its SocketChannel(s) ?
Trustin Lee
trustin at gleamynode.net
Fri Jan 16 02:33:45 EST 2009
Hi Meh-Lit,
By default, the number of selector threads is same with the number of
the CPU cores your application runs on. For example, four worker
threads will be launched on my quad core CPU machine.
Each connection will be assigned with one worker thread and one worker
thread can handle more than one connection. For example, if you've
got 10000 connections to handle and 4 worker threads (i.e. 4 selector
loops), then each worker thread will handle 2500 (10000 / 4)
connections approximately.
Please note that this is an approximation because a channel can not
change its worker thread once a worked thread is assigned. Therefore,
there's a chance where a certain worker thread handles more
connections than others, but it should not be an issue in the real
world.
HTH,
— Trustin Lee, http://gleamynode.net/
On Wed, Jan 14, 2009 at 3:30 PM, Meh-Lit Kim <mehlitkim at yahoo.com> wrote:
>
> With Netty, I understand that there is a thread pool for server socket
> listener and another worker thread pool for the handler for incoming data.
>
> But how many threads can Netty use for doing select()s that cover all of its
> SocketChannel(s) ?
>
> If I have a large number of SocketChannel(s), I would like to spread them
> across many select(s), each of which is in its own separate thread.
>
> Is it just 1 thread for select() or can Netty be configured to use more than
> 1 thread for select() ?
> If so, how to do this ?
>
> Thanks.
> --
> View this message in context: http://n2.nabble.com/How-many-receiver-threads-can-netty-use-for-all-its-SocketChannel%28s%29---tp2155354p2155354.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