2

I am about to develop a server that will hold up to 500 online connections, each one of about 10 mins, and that will recieve about 1 request per second. I want to configure the bossGroup and workerGroup so every message will be analyzed on its own Thread.

I have googled a lot but I have not find anything. Anyone knows how can I do that?

alvaromat
  • 87
  • 11

1 Answers1

3

No, this is the wrong way to think about Netty.

One thread per request is classic Java EE app server thinking. Netty uses non-blocking I/O.

A better way to look at it would be to view work as an assembly line. Let each process do its bit and put the results back for the next one to handle.

You need to change your thinking when you use Netty and vert.x:

Can the thread per request model be faster than non-blocking I/O?

How does the Netty threading model work in the case of many client connections?

Community
  • 1
  • 1
duffymo
  • 305,152
  • 44
  • 369
  • 561
  • Okay, now I know that I mustn't create a thread per each request, but I still don't know the best way to configure the work/boss groups nor how do they work. – alvaromat Oct 09 '14 at 10:13
  • You might have to do some hard learning now. SO isn't the place for that. Come back with specific questions. – duffymo Oct 09 '14 at 11:26
  • But there is no documentation about that. Nettys webpage redirects here to ask answers. – alvaromat Oct 09 '14 at 16:34
  • 2
    Take a look at http://seeallhearall.blogspot.co.uk/2012/05/netty-tutorial-part-1-introduction-to.html. It's a couple of years old so there might have been a few changes, but this is a great tutorial of most of the basic netty concepts which haven't changed that much in each incarnation (even if the API has in places) – johnstlr Oct 10 '14 at 15:32