Optimizing Netty for fast socket accept/creation

"이희승 (Trustin Lee)" trustin at gmail.com
Thu Jul 9 14:41:07 EDT 2009


Hi,

On 07/09/2009 11:17 PM, Jeanfrancois Arcand wrote:
> Salut,
> 
> sorry for the delay...
> 
> 
> 이희승 (Trustin Lee) wrote:
>> Hey JF,
>>
>> Good to see you here. :)
>>
>> On 07/09/2009 12:30 AM, Jeanfrancois Arcand wrote:
>>> Salut,
>>>
>>> 이희승 (Trustin Lee) wrote:
>>>> Hi Carl,
>>>>
>>>> One more question. :)
>>>>
>>>> Does the accept throughput increase linearly as the number of accept
>>>> threads (the number of bound ports in your case) increases?
>>>>
>>>> If you take a look at NioServerSocketPipelineSink.java:161, you will
>>>> see
>>>> the following code:
>>>>
>>>>     bossExecutor.execute(new IoWorkerRunnable(
>>>>             new ThreadRenamingRunnable(
>>>>                     new Boss(channel),
>>>>                     "New I/O server boss #" + id +
>>>>                     " (channelId: " + channel.getId() +
>>>>                     ", " + channel.getLocalAddress() + ')')));
>>>>
>>>> I increased the number of acceptor threads like the following:
>>>>
>>>>     for (int i = 0; i < 2; i ++) {
>>> How many core your machine has? We usually use the number of core as an
>>> indication.
>>
>> 4.  Do you mean the same ServerSocketChannel is registered to multiple
>> selectors with OP_ACCEPT in Grizzly?
> 
> Yes we did some test with multiple Selector for OP_ACCEPT. At the time I
> only tested using HTTP (which is far from representative) and the
> scalability was a little better, but throughput was lower. Did you have
> a chance to test it? I will try to test it using your echo benchmark to
> see what I'm getting.

I also did some testing and optimization after my previous post in this
thread.  It was difficult to get the result that indicates more than one
thread yields better performance.  I decided to stick to one accept
thread. :)

Thanks for trying to help!
Trustin



More information about the netty-users mailing list