-
Notifications
You must be signed in to change notification settings - Fork 84
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
Higher Latency compared to Tokio #27
Comments
Good question! It needs us investigate deeply. I have a blog that analysis why using hyper based porting is slow. those numbers are coming from such conditions: while I have a minihttp, that should be a fair comparison. tokio_minihttp Thread Stats Avg Stdev Max +/- Stdev
Latency 1.98ms 284.06us 12.53ms 98.92% vs Thread Stats Avg Stdev Max +/- Stdev
Latency 1.70ms 812.42us 20.17ms 97.94%
|
👍 looks good. I am planning to convert my existing threaded application to |
Your application is very special, there are enough resources for every thread and only 8 connections running on 16 cores! I think you can try clone each stream into two part: one for reading and one for writing, so that read and write don't block each other. and spawn coroutines to handle each request. Don't forget to config the io_workers to a reasonable number, so that fully utilize the CPU. |
Is it possible to reduce jitter if we use a work stealing queue per worker thread instead of a global mpmc queue for coroutines? |
@alkis |
Is there some documentation on the tradeoffs and/or different designs for the scheduler? More particularly why do we need separate io_workers? How does it compare to N generic workers plus a single |
well, at the beginning I do use unified thread to handle all of the events, but it's not as efficient as I expect. the sync primitive events and the timeout events would not go through the io thread, they are scheduled in normal worker thread. if generate event to the epoll system, this would have another system call which is not necessary. running coroutines in normal worker thread for the io event would have a noticeable delay after receiving the io event which generated in io worker thread. |
For the record, I wrote (with GuillaumeGomez) an FTP server with tokio and one with may and the version with |
Can you please share your results? Did you measure latency differences? |
I'll write a blog post with Guillaume (hopefully soon) to talk about our experience and show these results. |
Hello @Xudong-Huang, thanks for your great work! I'm very interested in may and would like to know if you have more recent data on tokio vs may? |
Thank you for creating this high-performance library and making async easier. Reading your blog, it seems average and peak latency seems to be higher compared to tokio based implementation.
Is this due to higher throughput or scheduling coroutine?
e.g.
Tokio threaded:
vs
May coroutine:
The text was updated successfully, but these errors were encountered: