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
taking uvloop into production? #15
Comments
uvloop only works with asyncio. It cannot work with Tornado, gevent, curio, or any other async Python library other than asyncio.
asyncio is an async library that implements many low-level and high-level abstractions. It has Protocols and Transports, helpers to create network servers and clients, etc. I highly recommend you to glance over the documentation. asyncio is built around the event loop. That's the thing that runs asyncio. uvloop is an implementation of a fast event loop for asyncio. Now, asyncio, by itself, doesn't provide any high-level tools for you to write applications. For instance, it lacks an HTTP protocol implementation, etc. You need other libraries built for asyncio to do that for you. For HTTP, right now, there is aiohttp. There are many other libraries for working with databases, using AMQP brokers, etc.
Once you have an asyncio application, speeding it up with uvloop is very easy -- just install the uvloop policy (see the README file). |
Do you mean I should review uvloop's documention or asyncio's?
In your blog post you mentioned that the performance in aiohttp was pretty bad with uvloop due to aiohttp's HTTP parser. Wouldn't httptools be the prefered library for handing HTTP requests in order to maintain the performance measured in the benchmarks? |
asyncio documentation to get a better idea of what it's capable of.
Right. The httptools package at this moment doesn't provide an implementation of HTTP, it only has a high-performance parser. So right now, aiohttp is the only option, but I hope its newly discovered performance issues will be fixed soon (by incorporating httptools or somehow else). |
There was already an issue open over at aiohttp for swapping out the http parser for httptools. If the performance issues could be solved in the near future both libraries could be thrown into the spotlight. Being able to stay on the same performance level with Go is huge. Thank you so much for contributing this library to the community! |
Thanks! |
This is not an issue but perhaps a request to maybe expand on documentation on how to use uvloop with other frameworks. The performance on it is very impressive, however, it's so low level, taking this into a production application would be quite a challenge.
What would be the best practice approach to doing this? Combine with tornado or any other async libary? Leverage other smaller libraries to handle things like user authentication and http parsing. Or does uvloop just need these features introduced directly into it to maintain the performance it currently has?
If I am using the wrong forum for asking this question I apologize and happy to move this discussion somewhere else.
The text was updated successfully, but these errors were encountered: