草庐IT

Gunicorn

全部标签

python - Django - 使用 Gunicorn、Nginx 和 Supervisor 进行部署,Gunicorn 错误日志

我已经使用Gunicorn+Nginx+Supervisor部署了一个Django1.6应用程序。一切正常,但我的Gunicornerror.log一直在发送错误。该文件很大,它每秒都会向日志文件发送错误。来自Gunicornerror.log的错误:2014-02-2714:25:09[9235][INFO]Startinggunicorn18.02014-02-2714:25:09[9235][ERROR]Connectioninuse:('127.0.0.1',8000)2014-02-2714:25:09[9235][ERROR]Retryingin1second.2014-0

python - Graphite 和 GUnicorn - 配置问题或路径问题

我一直在尝试让Graphite通过GUnicorn运行(最终通过nginx代理),但是我已经尝试了几乎所有启动应用程序的方法,但无法解决类似于以下的错误。(graphite)/opt/graphite/confgunicorn--bind=127.0.0.1:8080graphite.wsgi:app2014-03-0317:02:14[312][INFO]Startinggunicorn18.02014-03-0317:02:14[312][INFO]Listeningat:http://127.0.0.1:8080(312)2014-03-0317:02:14[312][INFO]

python - Gunicorn 创建了多少应用程序实例

我是新手,误解了Gunicorn+Flask的工作原理。当我用4个worker运行Gunicorn时,它会创建我的Flask应用程序的4个实例,或者它会创建4个进程来处理来自Nginx的Web请求和一个Flask应用程序实例?如果我在我的应用程序中简单实现内存缓存(例如字典),gunicorn是否会创建多个应用程序实例并因此创建多个缓存实例? 最佳答案 它将创建4个gunicornworker来处理一个flask应用程序。如果你旋转4个flask应用程序实例(例如使用docker),你将需要运行gunicorn4次。最后,要处理所有

python - Flask Gunicorn 应用无法让 __name__ 等于 '__main__'

我从/home/myname/myapp/app.py中得到了这个:fromflaskimportFlaskapp=Flask(__name__)print__name__@app.route('/')defindex():return"Helloworld!"if__name__=='__main__':print'inif'app.run()当我运行时:$gunicornapp:app-b127.0.0.2:8000它说:2013-03-0111:26:56[21907][INFO]Startinggunicorn0.17.22013-03-0111:26:56[21907][IN

python - 使用 Flask 和 gunicorn 为服务器加载全局数据

我已经使用Flask框架实现了简单的API,现在我正在尝试将它部署到gunicorn服务器。我的服务器脚本如下所示:app=Flask(__name__)classServer(object):def__init__(self,data):self.data=data@app.route("/api_method",methods=['GET','POST'])defapi_method():returnserver.dataif__name__=='__main__':withsmart_open(sys.argv[1])asf:server=Server(f.read())app.

python - 主管不使用 Gunicorn + Flask

我正在尝试在Ubuntu12.04系统中从Supervisor运行Gunicorn。Gunicorn运行Flask应用程序(使用Flask的嵌入式服务器测试的简单RESTWeb服务)。我通过克隆GIT存储库安装了Gunicorn,试图避免“apt-getinstall”,因为它在安装时运行Gunicorn服务器。我不希望它运行,它只会由Supervisor运行。所以在安装之后,如果我尝试:cd/usr/local/bingunicornmy_app:app-c/path/to/gu_config_fileGunicorn有效。然后我杀了它。注意没有扩展名的配置文件,因为扩展名“.py”

python - Gunicorn(Python3.4 和 3.3)仅在响应中发送没有数据的 header

我在云中有vm,python3.3(也尝试过3.4-结果相同)和Gunicorn18。我复制/粘贴“helloworld”应用程序(app.py):defapp(environ,start_response):data="Hello,World!\n"start_response("200OK",[("Content-Type","text/plain"),("Content-Length",str(len(data)))])returniter([data])然后运行gunicorn-w4-b0.0.0.0:8000app:appworkers开始没有错误,但是当我尝试用浏览器打开它

python - 无法使用 gunicorn 守护进程模式获取 Flask 的日志记录工作

我正在使用gunicorn+Nginx运行Flask网络应用程序。我在daemon模式下运行gunicorn。我配置了gunicorn和nginx来记录它们对文件的访问和错误。但我无法将Flask日志写入文件。我使用一个shell文件来启动我的带有gunicorn的应用程序:#!/bin/bashexportVIRTUAL_ENV="/to/virtual/path"exportPATH="$VIRTUAL_ENV/bin:$PATH"source"$VIRTUAL_ENV/bin/activate"NAME="hello"NUM_WORKERS=1execgunicornhello:

python - 主管 : ERROR (spawn error) when trying to launch gunicorn

我一直在尝试与主管一起设置gunicornpertheseinstructions.但是当我运行时sudosupervisorctlrereadsudosupervisorctlupdatesudosupervisorctlstartServer-CardLearning我收到错误Server-CardLearning:E​​RROR(spawnerror)。我的配置文件很简单。[program:Server-CardLearning]command=gunicornapp:app-blocalhost:8000directory=/home/alexg/www/user=www-da

python - django gunicorn sock 文件不是由 wsgi 创建的

我的digitalocean服务器(Ubuntu16.04)中有一个基本的djangorest应用程序,具有本地虚拟环境。基本的wsgi.py是:importosos.environ.setdefault("DJANGO_SETTINGS_MODULE","workout_rest.settings")#ThisapplicationobjectisusedbyanyWSGIserverconfiguredtousethis#file.ThisincludesDjango'sdevelopmentserver,iftheWSGI_APPLICATION#settingpointsher