Nilushan Costa
Nilushan Costa

Reputation: 306

Changing the number of Netty worker threads

I used the code from Writing an Echo server on the Netty website to create an Echo server using Netty 4.1. I want to run some tests by sending requests to it using Apache JMeter.

I want to change the number of worker threads in this Netty server to 100 and run some tests. So what I did was I changed the following line of code in the DiscardServerHandler by specifying the number of threads as the argument in the constructor.

EventLoopGroup workerGroup = new NioEventLoopGroup(100);

Can someone please tell me whether this is the correct way to change the number of worker threads?

However when took a thread dump, I did not see that many threads created.

Upvotes: 1

Views: 1493

Answers (1)

Norman Maurer
Norman Maurer

Reputation: 23557

Yes thats the correct way of doing it. That said these will be started in a lazy fashion which means you will only see them once these were used the first time. So you will need to have at least 100 Channels (connections) handled first to see all of Threads.

Upvotes: 1

Related Questions