single channelpipeline vs multiple channelpipelines

"Trustin Lee (이희승)" trustin at gmail.com
Thu Jun 3 04:55:14 EDT 2010


Hello Anthony,

A new pipeline is created for each newly accepted connection, as
documented in ChannelPipelineFactory.  Therefore, binding to one port
should be enough.  Serving thousand connections will create thousand
pipelines. :)

HTH,
Trustin

anthony_w wrote:
> Hello Netty users.  I just started exploring Netty about 3 weeks ago and like
> what I see.  My intention is to use Netty to create a device simulation
> environment.  I have a client application that can TCP/IP connect to many
> devices on the network via each devices ip/port.  Since I can't
> realistically test with 1000 devices, I plan to use a netty server app
> running on one machine, to simulate multiple devices.  So here is where I
> need some help understanding how and what I should do with Netty.  My two
> ideas were as follows (I hope my terminology is correct):
> 
> 
> 1) Bind to single server port (as seen in all the examples).  Add a handler
> to the default channel pipleline.  And the handlers implementation would
> determine which "device" the inbound message was intended for and then
> process it properly.  Sort of a "routing" within the handler to some
> business logic.
> 
> 
> 2) Bind to 1000 ports.  Each port has it's own channel pipleline and thus
> the handler doesn't really need to handle any "routing".  It's basically
> been accomplished on the client side by connecting to the correct port that
> equates to device X.
> 
> 
> So here is where my questions arise.
> 
> #1 is doable, but would I be trying to push too much through a single port
> when my simulation starts to scale?  (2000 devices, 3000 devices, etc)
> 
> #2 are multiple channel pipelines even feasable within Netty?  
> 
> 
> So any advice would be helpful regarding my implementation ideas.  I've got
> a thick skin so I won't be offended if someone replies back and say "this is
> the stupidest thing I've ever heard" :-)
> 
> Anthony.

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/



More information about the netty-users mailing list