urgent Performance issues

Carl Byström cgbystrom at gmail.com
Mon Aug 30 11:54:08 EDT 2010


On Mon, Aug 30, 2010 at 1:20 PM, ynotNetty <yair at traffixsystems.com> wrote:

> this is a surley not the ideal way to do parsing of a message , can you
> suplly us with a better way that doesn't involve allocation of bytebuffer
> for each message ?
>

Take a look at
http://docs.jboss.org/netty/3.2/api/org/jboss/netty/buffer/ChannelBuffer.html#toByteBuffer()
Or consider making your code speak ChannelBuffers (parseMessage)


>
> 2. what do you recommened about tuning the netty to work with large number
> of Clients - one server
> with a average message length of 1000B wuth a high volume of messages per
> second (aroung 40-50K)
>

I don't have any specific suggestions other than to equip yourself with a
good Java profiler. I've personally used JProfiler to hunt down performance
problems.
Perhaps others can fill in?


>
> 2.a) should we have one instance of ExeuterHandler per all the channels or
> should we create a new instance for every channel)
>

You can use the same instance. As you can see by the API docs, it's marked
"sharable".
http://docs.jboss.org/netty/3.2/api/org/jboss/netty/handler/execution/ExecutionHandler.html


> 2.b) should the executerHandler should use one instance of ThreadExecuter
> or
> a new one for each channel.
>

That depends on your use-case. If you are using the same ThreadPoolExecutor
for all your channels they will share it.
This is probably what you want. You should also take a look at
the OrderedMemoryAwareThreadPoolExecutor instead
of MemoryAwareThreadPoolExecutor.

--
Carl

--
Carl Byström
http://www.pedantique.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20100830/fbebd8ec/attachment-0001.html 


More information about the netty-users mailing list