Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

ref(gunicorn): use gaiohttp workers #794

Closed
wants to merge 1 commit into from

Conversation

mboersma
Copy link
Member

@mboersma mboersma commented Jun 7, 2016

Summary of Changes

Replaces the default sync gunicorn worker class with gaiohttp. This async worker class is based on aiohttp for Python 3. It may offer better responsiveness and lower CPU load.

My preliminary testing shows it holds up well and uses less CPU, but I'll produce more specific benchmark results to justify this soon.

TODO:

  • produce more specific benchmark results
  • continue long-term testing to reassure myself about stability of this change

Testing Instructions

There are no specific testing instructions, since this should be an invisible backend change. However, monitoring for response times and CPU load over a long period of time would assure this does not introduce new problems.

Pull Request Hygiene TODOs

Please make sure the below checklist is complete.

  • Your pull request is concise and to the point (make another PR for refactoring nearby code)
  • Your commits are squashed into logical units of work
  • Your commits follow the commit style guidelines

🌸 Thank you! 🌸

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @helgi and @kmala to be potential reviewers

@bacongobbler
Copy link
Member

bacongobbler commented Jun 7, 2016

  • Supports both client and server Web-Sockets out-of-the-box.

This could be game changing. We've been looking for a websocket-compatible HTTP server that works with django for a while. This could mean that we could potentially support deis logs -f, right?

@helgi
Copy link
Contributor

helgi commented Jun 7, 2016

Should be able to, tho the alternative could have always been to have a logger endpoint (public) we could pass on the connection to the end user which could allow for it instead of piping via the API

@jgmize
Copy link
Contributor

jgmize commented Jun 7, 2016

While benchmarking, it might be interesting to also try out https://github.com/MagicStack/uvloop via the implementation in aio-libs/aiohttp#878. See http://magic.io/blog/uvloop-blazing-fast-python-networking/ for some existing benchmarks.

@mboersma mboersma force-pushed the gaiohttp-workers branch 2 times, most recently from 6a01662 to a55676a Compare June 10, 2016 15:40
@codecov-io
Copy link

codecov-io commented Jun 10, 2016

Current coverage is 86.57%

Merging #794 into master will decrease coverage by 0.07%

@@             master       #794   diff @@
==========================================
  Files            30         30          
  Lines          2712       2711     -1   
  Methods           0          0          
  Messages          0          0          
  Branches        441        441          
==========================================
- Hits           2350       2347     -3   
- Misses          240        242     +2   
  Partials        122        122          

Powered by Codecov. Last updated by 4974584...16b326a

@mboersma mboersma force-pushed the gaiohttp-workers branch 2 times, most recently from 53de89e to 8467e1f Compare June 11, 2016 18:11
@mboersma mboersma added this to the v2.1-pre1 milestone Jun 11, 2016
@mboersma mboersma force-pushed the gaiohttp-workers branch 4 times, most recently from 13b60ef to 16b326a Compare June 20, 2016 22:25
@mboersma
Copy link
Member Author

it might be interesting to also try out https://github.com/MagicStack/uvloop...

I did spend some time using the KeepSafe/aiohttp tip and trying to get it working as advertised, but ran into a variety of configuration issues I couldn't get past. I love the benchmarking numbers on uvloop, so let's revisit this when it's had time to mature. Hopefully just this gaiohttp change will help.

@mboersma
Copy link
Member Author

This seems promising, especially when paired with the potential of uvloop. But my boom and workflow-e2e test benchmarks have shown it doesn't perform quite as well as the trusty gunicorn sync worker.

So I'm closing this, but it would be smart for someone to revisit this territory in the future after #833 or #835 are (probably) merged.

@mboersma mboersma closed this Jun 22, 2016
@krancour krancour modified the milestones: v2.1, v2.1-pre1 Jun 29, 2016
duanhongyi pushed a commit to duanhongyi/workflow that referenced this pull request Dec 4, 2018
docs(monitoring): Update docs to reflect monitor chart changes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants