-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use multiple single threaded runtimes #23
Comments
This branch is using multiple single-threaded runtimes. Results on my computer: Multiple single threaded runtimes:
Current approach, regular
|
When using tokio with our proposed BWoS workstealing queue I measured the following improvements for hypers throughput when changing the 500 connectionsRewrk 0.3.2 with BWoS queue:
Rewrk 0.3.2 with original tokio (1.22):
1000 connectionsRewrk 0.3.2 with BWoS queue:
Rewrk 0.3.2 with original tokio (1.22):
The throughput increase (if only rewrk is changed) is not as much was what you measured, but still I thought this might be interesting. |
@jschwe Interesting... How does that compare to rewrk in this pull request? |
Ah, I did not see there was a pull request related to this issue. I'll try this out tommorow. Edit: Initial results do show that using multiple single threaded runtime still offers significant performance improvements. This is probably related to parking/unparking overhead. I'll post some more details tommorow. |
It would be interesting to see, if the performance is close enough I'm somewhat tempted to go with the approach you mentioned over the single threaded runtimes just for convenience. |
I compared the single threaded approach with the original strategy and differen BWoS strategies on an x86 machine with 2 numa nodes. It seems that the single threaded runtime does offer clear advantages, especially with less connections. This could be due to overhead from parking/unparking cores when there is not enough work, but I haven't investigated this further. 500 connections<style> </style>
750 connections<style> </style>
1000 connections<style> </style>
|
@jschwe So is it free performance if this design gets merged into tokio? |
@programatik29 Our current proposal is for our queue to be an integrated as an alternative Backend, which could be selected via a runtime flavor. So this is not going to be a drop in change for now, but would require the downstream user to select a different flavor to get the benefits of the new queue. That's a very minor change required for downstream users though. We do think our queue should be better in basically all scenarios, but there are situations where the queue is not the bottleneck, so switching it out wouldn't change much. |
This behaviour will be implemented in |
With recent updates to
tokio
, CPU can't be utilized to 100% withtokio::spawn
when usinghyper
. Performance ofrewrk
can be increased if multiple single threaded runtimes are used.I think it is a good idea because all connection tasks spawned by
rewrk
are identical so work stealing benefits aren't much.The text was updated successfully, but these errors were encountered: