ExecutionHandler and Boss thread

netty

Solution

Your understanding for Boss and Workers is right.

For the ExecutionHandler its a bit different. The ExecutionHandler hands-of event processing to an extra ThreadPool. This helps to make sure you don't "block" the Worker threads. The ExecutionHandler MUST be shared between the different Channels and so also across the Workers.

So if you have a Worker count of 10 and a core-thread-pool-size of 16 you will have 26 threads + the boss thread.

Hope this makes it clear.

Problem

I'm starting with "bare" netty in a project. I'm still going through all the amazing javadocs, but there's a point I did not get. So far what I got: There's one Boss thread which starts the bootstrap and binds the server to a socket port right? The worker threads (could be many of those) handle the incoming connections and create proper channels and pipelines right? But we then have the ExecutionHandler, which also can spam several other threads right? My point being is that if I have 10 worker threads, and a ExecutionHandler of corepoolsize=16, it means I may end with 160 concurrent threads on my system given a very heavy load? Sorry it feels dumb the question, but I'm just trying to make sense out of this part on the docs. Cheers

Original source