You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "immars (JIRA)" <ji...@apache.org> on 2010/05/21 12:27:16 UTC
[jira] Created: (THRIFT-786) Handling network I/O process in pooled
threads instead of selectThread_ in THsHaServer.java
Handling network I/O process in pooled threads instead of selectThread_ in THsHaServer.java
-------------------------------------------------------------------------------------------
Key: THRIFT-786
URL: https://issues.apache.org/jira/browse/THRIFT-786
Project: Thrift
Issue Type: Improvement
Components: Library (Java)
Affects Versions: 0.2
Environment: Linux 2.6.18 Xeon 5130 dual core X 2
Reporter: immars
In my test environment, I've made a few modification to TNonblockingServer and THsHaServer to let the thread pool executor to take over I/O handling. selectThread_ selects, maintains interestOps of all keys, and submit tasks when there is something to read or write.
This modification boosts my thrift server from 7k req/s to 10k req/s, using php client code. I think this is worth doing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-786) Handling network I/O process in
pooled threads instead of selectThread_ in THsHaServer.java
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870054#action_12870054 ]
Bryan Duxbury commented on THRIFT-786:
--------------------------------------
This sounds pretty interesting. I'll have a look at this later today.
I'm guessing the performance improvements come from the fact that you are managing to saturate the CPU/core that is running the select thread, so splitting the I/O out into several threads gets more concurrency.
> Handling network I/O process in pooled threads instead of selectThread_ in THsHaServer.java
> -------------------------------------------------------------------------------------------
>
> Key: THRIFT-786
> URL: https://issues.apache.org/jira/browse/THRIFT-786
> Project: Thrift
> Issue Type: Improvement
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux 2.6.18 Xeon 5130 dual core X 2
> Reporter: immars
> Attachments: THsHaServer.java, TNonblockingServer.java
>
>
> In my test environment, I've made a few modification to TNonblockingServer and THsHaServer to let the thread pool executor to take over I/O handling. selectThread_ selects, maintains interestOps of all keys, and submit tasks when there is something to read or write.
> This modification boosts my thrift server from 7k req/s to 10k req/s, using php client code. I think this is worth doing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-786) Handling network I/O process in pooled
threads instead of selectThread_ in THsHaServer.java
Posted by "immars (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
immars updated THRIFT-786:
--------------------------
Attachment: THsHaServer.java
TNonblockingServer.java
Please see the attachments.
It's not a formal patch, just illustrate the idea.
> Handling network I/O process in pooled threads instead of selectThread_ in THsHaServer.java
> -------------------------------------------------------------------------------------------
>
> Key: THRIFT-786
> URL: https://issues.apache.org/jira/browse/THRIFT-786
> Project: Thrift
> Issue Type: Improvement
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux 2.6.18 Xeon 5130 dual core X 2
> Reporter: immars
> Attachments: THsHaServer.java, TNonblockingServer.java
>
>
> In my test environment, I've made a few modification to TNonblockingServer and THsHaServer to let the thread pool executor to take over I/O handling. selectThread_ selects, maintains interestOps of all keys, and submit tasks when there is something to read or write.
> This modification boosts my thrift server from 7k req/s to 10k req/s, using php client code. I think this is worth doing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (THRIFT-786) Handling network I/O process in
pooled threads instead of selectThread_ in THsHaServer.java
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury reassigned THRIFT-786:
------------------------------------
Assignee: Bryan Duxbury
> Handling network I/O process in pooled threads instead of selectThread_ in THsHaServer.java
> -------------------------------------------------------------------------------------------
>
> Key: THRIFT-786
> URL: https://issues.apache.org/jira/browse/THRIFT-786
> Project: Thrift
> Issue Type: Improvement
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux 2.6.18 Xeon 5130 dual core X 2
> Reporter: immars
> Assignee: Bryan Duxbury
> Attachments: THsHaServer.java, TNonblockingServer.java
>
>
> In my test environment, I've made a few modification to TNonblockingServer and THsHaServer to let the thread pool executor to take over I/O handling. selectThread_ selects, maintains interestOps of all keys, and submit tasks when there is something to read or write.
> This modification boosts my thrift server from 7k req/s to 10k req/s, using php client code. I think this is worth doing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-786) Handling network I/O process in
pooled threads instead of selectThread_ in THsHaServer.java
Posted by "immars (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870284#action_12870284 ]
immars commented on THRIFT-786:
-------------------------------
yes.
In fact I'm implementing a service accepting requests from client and writing data to mysql server (sounds typical...) asynchronously.
In my previous observation, in most of time, all pooling threads are waiting for tasks; sql query handling threads are waiting for response from mysql server; the most busy thread is selectThread_.
> Handling network I/O process in pooled threads instead of selectThread_ in THsHaServer.java
> -------------------------------------------------------------------------------------------
>
> Key: THRIFT-786
> URL: https://issues.apache.org/jira/browse/THRIFT-786
> Project: Thrift
> Issue Type: Improvement
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux 2.6.18 Xeon 5130 dual core X 2
> Reporter: immars
> Attachments: THsHaServer.java, TNonblockingServer.java
>
>
> In my test environment, I've made a few modification to TNonblockingServer and THsHaServer to let the thread pool executor to take over I/O handling. selectThread_ selects, maintains interestOps of all keys, and submit tasks when there is something to read or write.
> This modification boosts my thrift server from 7k req/s to 10k req/s, using php client code. I think this is worth doing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-786) Handling network I/O process in pooled
threads instead of selectThread_ in THsHaServer.java
Posted by "immars (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
immars updated THRIFT-786:
--------------------------
Patch Info: (was: [Patch Available])
> Handling network I/O process in pooled threads instead of selectThread_ in THsHaServer.java
> -------------------------------------------------------------------------------------------
>
> Key: THRIFT-786
> URL: https://issues.apache.org/jira/browse/THRIFT-786
> Project: Thrift
> Issue Type: Improvement
> Components: Library (Java)
> Affects Versions: 0.2
> Environment: Linux 2.6.18 Xeon 5130 dual core X 2
> Reporter: immars
> Attachments: THsHaServer.java, TNonblockingServer.java
>
>
> In my test environment, I've made a few modification to TNonblockingServer and THsHaServer to let the thread pool executor to take over I/O handling. selectThread_ selects, maintains interestOps of all keys, and submit tasks when there is something to read or write.
> This modification boosts my thrift server from 7k req/s to 10k req/s, using php client code. I think this is worth doing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.