-
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
Example with aiohttp #5
Comments
What docs are you referring to? Aiohttp guys tried to port it to use httptools, but IIRC that work wasn't merged. |
Sorry, not exactly docs, the blog post for uvloop http://magic.io/blog/uvloop-blazing-fast-python-networking/ |
|
I believe the issue should be closed |
@nhumrich Not sure about aiohttp, but I just incorporated httptools into the web framework I'm writing, https://github.com/kespindler/albatross . Feel free to poke around my implementation if you want an example of using httptools. |
Since there are no plans about incorporating httptools into aiohttp, I'll just close this issue. |
Honestly I have such plan but aiohttp need some internal transformations on this way. |
After benchmarking, I found that This seems to be caused by the choice of abstraction levels in |
Would you publish your benchmarking code, please? You are right: current abstraction layers are tricky and slow, there are many spikes. P.S. |
@asvetlov Thanks for the reply. I'm using pretty much the same code as here: I found the logging bottleneck very quickly using PyPI |
@asvetlov Also, I found this project which seems to be at 10x Could be interesting to compare execution of a single request in-depth and see what can be ported back. |
difference is there... In my tests aiohttp gives ~7300 rps with uvloop and 6500 rps with regular ioloop, and sanic gives ~30000 rps. Clearly aiohttp is drastically inefficient. Below are "Hello World" tests on Dell XPS 15 (core i7, 4x cores) Python uvloop+httptools (1x core) = 70653 RPS ---- uvloop+httptools = 70653 RPS $ ./aiot.py --type=uvloop+httptools $ wrk -t2 -c50 -d10s http://127.0.0.1:8080/ --- uvloop+aiohttp = 7315 RPS $ wrk -t2 -c50 -d10s http://127.0.0.1:8080/ --- Sanic = 30716 RPS $ wrk -t2 -c50 -d10s http://127.0.0.1:8080/ --- Java Vert.x = 114713 RPS --- GoLang fasthttp = 321061 RPS |
I am preparing Docker images and testing different setups in a more realistic scenario: not on my local network, but on instances of Standard S1 machines in Azure West Europe data center (deploying services using ARM templates), running benchmark from Warsaw, Poland, using Apache Benchmark tool. I am not ready to share my code, yet; however I saw the following:
I also got decent performance with pypy3 + Gunicorn + SyncWorker class + Flask (multiple workers, of course). I will prepare tests to compare the performance of ASP.NET Core applications in Docker and outside of Docker, using Azure S1 machines, I am really curious how these compare. Also, I will get to know wrk and try to use it instead of Apache Benchmark. |
In your uvloop docs you talk about running aiohttp with this parser instead of the built in one. Do you have any documentation on how that would work?
The text was updated successfully, but these errors were encountered: