草庐IT

Gunicorn

全部标签

python - Django:通过manage.py使用服务器和gunicorn等其他服务器之间的区别。哪个更好?

我一直在使用manage.pyrunserver运行我的初学者Django项目。我看到了使用gunicorn的建议。有什么区别? 最佳答案 nginx和gunicorn可能是生产部署中最流行的配置。在详细说明为什么推荐gunicorn而不是runserver之前,让我们快速澄清一下nginx和gunicorn之间的区别,因为两者都声明它们是Web服务器。NGINX应该是你的公共(public)入口点,它是监听端口80(http)和443(https)的服务器。它的主要目的是处理HTTP请求,即应用重定向、HTTP身份验证(如果需要)

python - 如何使用在 gunicorn 上运行的 pycharm 2.x 调试 flask.app

我正在开发一个使用Web套接字功能并安装了flask-socket的flask.app提供。所以flask-socket开发者推荐gunicorn作为网络服务器。我现在的问题是如何将pycharm的remove调试器和gunicorn连接起来,用断点拦截执行。 最佳答案 设置>项目设置>Python调试器其中有一个选项可以启用“gevent兼容调试”。然后,进入调试器设置(快捷方式是通过工具栏,单击播放/调试图标附近的下拉菜单并选择“编辑配置”将“脚本”设置为您的virtualenv的gunicorn安装,类似于:/Users/ia

python - 有没有办法在 gunicorn 中记录 python 打印语句?

像这样使用我的Procfile:web:gunicornapp:app\--bind"$HOST:$PORT"\--error-logfile"-"\--enable-stdio-inheritance\--reload\--log-level"debug"是否有可能以任何方式将pythonprint语句记录到标准输出/bash?我在这里也使用bottle框架,如果这会影响任何东西的话。 最佳答案 事实证明print语句实际上是通过了,但是有延迟。gunicorndocsfor--enable-stdio-inheritance注意

python - gunicorn.errors.HaltServer : <HaltServer 'Worker failed to boot.' 3>

我已经在我的virtualenv中安装了gunicorn。从此目录:manage.py/onbytes/wsgi.py我运行以下命令:gunicornonbytes.wsgi:application我收到以下错误:Traceback(mostrecentcalllast):File"/home/ymorin007/.virtualenvs/onbytes.com/bin/gunicorn",line9,inload_entry_point('gunicorn==19.0.0','console_scripts','gunicorn')()File"/home/ymorin007/.vi

python - 在 Gunicorn 中共享内存?

我在我的网络服务中使用了一个大型只读数据结构(networkx中加载的图形,尽管这不应该很重要)。Web服务在Flask中构建,然后通过Gunicorn提供服务。事实证明,对于我启动的每个gunicornworker,它都拥有自己的数据结构副本。因此,当我有8个工作人员运行时,我的~700mb数据结构完全可以由一个工作人员管理,它变成了一个相当大的内存消耗。有什么办法可以在gunicorn进程之间共享这个数据结构,这样我就不必浪费这么多内存了? 最佳答案 看起来最简单的方法是tellgunicorntopreloadyourappl

python - Tornado vs wsgi(与 gunicorn)

我读过this关于Tornado:Ontheotherhand,ifyoualreadyhaveaWSGIappandwanttorunitonablazingfasttornado.httpserver.HTTPServer,wrapsitwithtornado.wsgi.WSGIContainer.Butyouneedtobecareful.Sinceyouroriginalapplicationisnotpreparedforanasynchronousserver,andwillmakealotofIO/computation,itwillblockotherrequestsw

python - 区分nginx、haproxy、varnish和uWSGI/Gunicorn

关闭。这个问题是off-topic.它目前不接受答案。想改善这个问题吗?Updatethequestion所以它是on-topic对于堆栈溢出。9年前关闭。Improvethisquestion我对系统管理员的东西真的很陌生,并且只配置了一个带有nginx(提供静态文件)和gunicorn作为Web服务器的VPS。我最近一直在阅读其他不同的东西。我开始了解其他工具:nginx:高性能HTTP服务器和反向代理,以及一个IMAP/POP3代理服务器haproxy:高性能负载均衡器varnish:缓存HTTP反向代理gunicorn:pythonWSGIhttp服务器uwsgi:另一个pyt

python - 如何调试 gunicorn 失败问题? ( worker 无法启动)

我有一个使用Gunicorn并且在本地运行良好的DjangoWeb应用程序,但是当我在EC2上部署应用程序时,我发现Gunicorn失败了:$gunicorn_django-b127.0.0.1:8000--settings=myapp.settings.dev--debug--log-levelinfo2012-09-1617:39:24[28333][INFO]Startinggunicorn0.14.62012-09-1617:39:24[28333][INFO]Listeningat:http://127.0.0.1:8000(28333)2012-09-1617:39:24[

python - 当名称从 "application"更改时,Gunicorn 找不到应用程序

我使用gunicorn--workers3wsgi来运行我的Flask应用程序。如果我将变量application更改为myapp,Gunicorn会给出错误AppImportError:Failedtofindapplication:'wsgi'。为什么会出现此错误,如何解决?myproject.py:fromflaskimportFlaskmyapp=Flask(__name__)@myapp.route("/")defhello():return'Test!'if__name__=="__main__":myapp.run(host='0.0.0.0')wsgi.py:fromm

python - 让 gunicorn 运行的正确方法是什么?

我想做一个Flask+Nginx+Gunicorn部署。我已经设置并运行了Nginx,并且按照文档中的描述运行gunicorn:gunicornapp:app但是当我注销服务器时,gunicorn进程会退出吗?确保Nginx连接到它并在崩溃时重新启动的正确方法是什么? 最佳答案 在运行gunicorn时使用--daemon选项。示例:gunicorngrand56.wsgi:application--namegrand56--workers3--user=root--group=root--bind=127.0.0.1:1001--