Rndm
Rndm

Reputation: 6860

netty , tomcat threading model

I am a newbie to this and I am sorry if my question may seem to be too naive to experienced netty , tomcat users.

I am running a Netty websocket server(using the sample code and running on port 8090) configured through spring inside tomcat(running on port 8080). I am trying to understand the threading models of both and overall how would it work.

As I understand, tomcat by deafult sets the maxThreads = 200 (max number of active threads). While netty uses boss threads to create and connect/bind sockets and then pass them off to the worker threads , which do the actual asynchronous I/O.

Now I am trying to understand :

EDIT :

And accordingly are there any specific points that should be kept in mind while coding the weboscket server ?

Upvotes: 4

Views: 2152

Answers (1)

Norman Maurer
Norman Maurer

Reputation: 23557

In Netty you specify the ThreadPool by passing an Executor to the constructor. So as long as you don't use the same pool as you use in Tomcat it should not effect the available threads.

Netty's Webseocket implementation can be used with its NIO transport. In this case you would share a number of threads between connections. So there isn't a 1:1 mapping from connection to threads.

Upvotes: 5

Related Questions