Tag: gunicorn

gunicorn.errors.HaltServer:<HaltServer'Worker无法启动。 3> django

我有一个Django的应用程序,并试图设置它与gunicorn第一,后来与主pipe和nginx。 该应用程序正常运行与正常的Django命令完全像python manage.py runserver 我安装gunicorn使用pip像pip install gunicorn和django版本是1.5.3 当我在下面的虚拟env中运行下面的命令 gunicorn hello.wsgi:application -b xx.xxx.xxx.xx:8000并面临错误 Traceback (most recent call last): File "/root/Envs/proj/bin/gunicorn", line 9, in <module> load_entry_point('gunicorn==19.0.0', 'console_scripts', 'gunicorn')() File "/root/Envs/proj/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() File "/root/Envs/proj/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 166, in run super(Application, self).run() File "/root/Envs/proj/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 71, in run Arbiter(self).run() File "/root/Envs/proj/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 169, in […]

如何修改Procfile在Heroku的非标准文件夹中运行Gunicorn进程?

我是新来的heroku和gunicorn,所以我不知道这是如何工作的。 但我已经做了一些search,我想我已经接近部署我的Django应用程序(1.5.1)。 所以我知道我需要一个Procfile web: gunicorn app.wsgi 因为我的目录有点不同 我不能在根目录下运行gunicorn app_project requirements/ contributors/ app/ app/ settings/ wsgi.py # Normally Procfile goes here Procfile 通常应用程序/将是根目录,但我决定这样构造我的文件夹来分隔我的Django应用程序从其他一些事情。 由于我必须把procfile放在heroku的根目录下才能识别,我应该在procfile中join什么和/或者我应该在gunicorn命令中join什么参数? 注意: web: gunicorn app.wsgi # won't work because Procfile is in a directory above # I also want to keep the directories as is # I also don't want to create a […]

什么是前叉Web服务器模型?

我想知道当Web服务器将自己描述为预分叉Web服务器时,究竟意味着什么。 我有几个例子,如独angular兽的ruby和pythongunicorn 。 更具体地说,这些是问题: 这个模型解决了什么问题? 预分叉Web服务器最初启动时会发生什么? 它如何处理请求? 此外,一个更具体的问题独angular兽/ gunicorn: 比方说,我有一个web应用程序,我想与(g)独angular兽运行。 在初始化时,webapp会做一些初始化的东西(例如填写额外的数据库条目)。 如果我configuration(g)独angular兽与多个工人,将初始化的东西多次运行?

语法错误安装gunicorn

我正在关注这个Heroku教程: https ://devcenter.heroku.com/articles/getting-started-with-python-o当我试图在virtualenv中安装gunicorn时,我得到这个错误: (venv)jabuntu14@ubuntu:~/Desktop/helloflask$ pip install gunicorn Downloading/unpacking gunicorn Downloading gunicorn-19.1.1-py2.py3-none-any.whl (104kB): 104kB downloaded Installing collected packages: gunicorn Compiling /home/jabuntu14/Desktop/helloflask/venv/build/gunicorn/gunicorn/workers /_gaiohttp.py … File "/home/jabuntu14/Desktop/helloflask/venv/build/gunicorn/gunicorn/workers /_gaiohttp.py", line 64 yield from self.wsgi.close() ^ SyntaxError: invalid syntax Successfully installed gunicorn Cleaning up… 但是,当我运行$领class启动它似乎正常工作。 这个错误有多重要? 任何想法如何解决它?

在git pulling我的Django项目之后重启/重载Gunicorn(通过Upstart)的更好方法

我寻找的东西比sudo restart projectname每次我发出一个git pull origin master ,这拉下了我的最新变化Django项目。 我相信这个restart命令与Upstart有关,我用它来启动/顶部我的Gunicorn服务器进程。 此重新启动会导致短暂的中断。 用户点击Web服务器(nginx)将得到500,因为Gunicorn仍在重新启动。 实际上,它似乎立即重启,但页面加载需要几秒钟的时间。 任何想法如何使这无缝? 理想情况下,我想要发出我的git pull而Gunicorn会自动重新加载。

Gunicorn的Nginx超时问题

我在gunicorn + nginx上运行django。 我正面临file upload的问题。 其实上传工作正常,但gunicorn超时,从而造成这在nginx: 2011/07/25 12:13:47 [error] 15169#0: *2317 upstream timed out (110: Connection timed out) while reading response header from upstream, client: IP-ADDRESS, server: SERVER, request: "GET /photos/events/event/25 HTTP/1.1", upstream: "http://127.0.0.1:29000/photos/events/event/25", host: "HOST", referrer: "REFERER_ADDRESS" 如果我刷新页面,我可以看到所有的照片上传就好了。 问题是,它会导致超时,从而给上传不起作用的印象。 这里是我的gunicorn conf: bind = "127.0.0.1:29000" logfile = "/path/to/logs/gunicorn.log" workers = 3 我试着改变超时时间,但没有奏效。

debugging在Gunicorn运行的Flask应用程序

我一直在为我的应用程序使用nginx / gunicorn和Flask开发一个新的开发平台。 Ops明智,一切工作正常 – 我遇到的问题是debuggingFlask层。 当我的代码出现错误时,我只是得到一个直接返回到浏览器的500错误,没有任何东西显示在控制台或我的日志中。 我已经尝试了许多不同的configuration/选项..我想我一定是错过了一些明显的东西。 我的gunicorn.conf: import os bind = '127.0.0.1:8002' workers = 3 backlog = 2048 worker_class = "sync" debug = True proc_name = 'gunicorn.proc' pidfile = '/tmp/gunicorn.pid' logfile = '/var/log/gunicorn/debug.log' loglevel = 'debug' borks- testserver.py的一些Flask代码的例子: from flask import Flask from flask import render_template_string from werkzeug.contrib.fixers import ProxyFix app = Flask(__name__) […]

NGINX和Gunicorn并行运行的目的是什么?

亚马逊EC2上的很多Django应用程序部署使用HTTP服务器NGINX和Gunicorn。 我想知道他们实际上做了什么,为什么这两个是并行使用。 同时运行它们的目的是什么?

一个Flask进程接收多less个并发请求?

我正在用Flask构build一个应用程序,但是我对WSGI不太了解,而且它是HTTP基础,Werkzeug。 当我开始使用gunicorn和4个工作进程来提供Flask应用程序时,这是否意味着我可以处理4个并发请求? 我的意思是并发请求,而不是每秒或其他任何请求。 谢谢!

gunicorn自动重新加载源代码

最后,我将我的开发环境从runserver迁移到gunicorn / nginx。 将runserver的autoreload特性复制到gunicorn中会很方便,所以当源发生变化时服务器会自动重启。 否则,我必须用kill -HUP手动重启服务器。 任何方式来避免手动重启?