1
cheetah 2017-03-20 18:54:44 +08:00
弱弱的问一句, Gunicorn 自带的 AiohttpWorker 不能运行 sanic?
|
2
est 2017-03-20 19:04:12 +08:00
66666
|
4
messense OP @cheetah 根本起不来
gunicorn simple_server:app --bind localhost:8000 --worker-class gaiohttp --capture-output [2017-03-20 20:13:34 +0800] [3226] [INFO] Starting gunicorn 19.6.0 [2017-03-20 20:13:34 +0800] [3226] [INFO] Listening at: http://127.0.0.1:8000 (3226) [2017-03-20 20:13:34 +0800] [3226] [INFO] Using worker: gaiohttp [2017-03-20 20:13:34 +0800] [3260] [INFO] Booting worker with pid: 3260 Application object must be callable. [2017-03-20 20:13:34 +0800] [3260] [INFO] Worker exiting (pid: 3260) [2017-03-20 20:13:34 +0800] [3226] [INFO] Shutting down: Master [2017-03-20 20:13:34 +0800] [3226] [INFO] Reason: App failed to load. 也需要一些 hack ,比如类似: https://github.com/messense/sanic-gunicorn/commit/e60a683f976cd66a36f3c1ee88b92f4be190067a#diff-757823b0d65a4f88a48899c3fd4135c8R54 或者自己实现下 __call__ |
5
messense OP @cheetah #4 actually ,即便实现了 __call__ 也不好继续下去,因为 Sanic 并不兼容 WSGI , gunicorn 的 gaiohttp worker 是基于 WSGI 的
|
6
messense OP @cheetah aiohttp 2.0 也废弃了 WSGI 支持,估计以后 gaiohttp 也没法用了。
http://aiohttp.readthedocs.io/en/latest/migration.html#wsgi |
7
freestyle 2017-03-20 23:11:27 +08:00
问一下 sanic 跑同步的 wsgi 不会浪费性能吗
|
8
messense OP @freestyle #7 并不是同步跑 WSGI ,自定义 gunicorn worker 跑 asyncio event loop
|
9
guyskk 2017-03-21 21:58:43 +08:00
ORM 支持怎么样了?楼主有打算在生产环境用 sanic 吗?
|
10
messense OP |