[ 
https://issues.apache.org/jira/browse/THRIFT-1167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13047373#comment-13047373
 ] 

Steve Jiang commented on THRIFT-1167:
-------------------------------------

Vijay, it looks like we took a similar approach.  A couple of comments:

In your server all the IO threads are selecting on the server socket, and you 
let whichever one accepts first "win" while the losers are doing a small bit of 
unnecessary work.  In the case of frequent accepts I've seen cases where this 
is enough of a penalty to matter, it depends on the situation. As far as the 
loadbalancing, I think the round-robin default will give a similar result to 
what kernel thread scheduling gives in most cases, with an option to do 
something smarter if needed.

There's nothing throttling accepts if the invoker pool is saturated, which can 
make bad situations worse.  That is a must-have for my app.

That being said, it's a smaller change and doesn't touch the existing servers 
so it's less risky to commit.  I'd probably subclass if this is the version 
thrift goes with.

> Java nonblocking server with more than one thread for select and handling IO
> ----------------------------------------------------------------------------
>
>                 Key: THRIFT-1167
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1167
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Library
>            Reporter: Steve Jiang
>            Assignee: Bryan Duxbury
>         Attachments: TSHSHAServer-Patch-MultiThreaded_v3.patch, 
> threadedselectorthrift3.diff
>
>
> I've used the HsHa server model to write a server that uses a thread for 
> accept and a separate, configurable number of Selector threads to handle IO.  
> I'd like to contribute this back to Thrift.
> For apps that are RPC-heavy and require little computation from the executor 
> pool running on multi-core architectures, this server allows gets throughput 
> as IO is not limited by one CPU.
> Please take a look at the attached patch.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to