gunicorn

ERROR: Invalid HTTP_HOST header: '/webapps/../gunicorn.sock'

人盡茶涼 提交于 2019-12-17 19:13:29
问题 After I deployed my Django App last night I got tons of strange Emails saying: ERROR: Invalid HTTP_HOST header: '/webapps/example_com/run/gunicorn.sock I'm sure this is somehow related to the following nginx config: upstream example_app_server { server unix:/webapps/example_com/run/gunicorn.sock fail_timeout=0; } server { listen 80; server_name example.com; client_max_body_size 4G; access_log /webapps/example_com/logs/nginx-access.log; error_log /webapps/example_com/logs/nginx-error.log;

Gunicorn, no module named 'myproject

随声附和 提交于 2019-12-17 18:01:17
问题 I'm installing a previously built website on a new server. I'm not the original developer. I've used Gunicorn + nginx in the past to keep the app alive (basically following this tutorial), but am having problems with it here. I source venv/bin/activate , then ./manage.py runserver 0.0.0.0:8000 works well and everything is running as expected. I shut it down and run gunicorn --bind 0.0.0.0:8000 myproject.wsgi:application , and get the following: [2016-09-13 01:11:47 +0000] [15259] [INFO]

Heroku Sporadic High Response Time

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 17:57:06
问题 This is very specific, but I will try to be brief: We are running a Django app on Heroku . Three servers: test (1 web, 1 celery dyno) training (1 web, 1 celery dyno) prod (2 web, 1 celery dyno). We are using Gunicorn with gevents and 4 workers on each dyno . We are experiencing sporadic high service times . Here is an example from Logentries: High Response Time: heroku router - - at=info method=GET path="/accounts/login/" dyno=web.1 connect=1ms service=6880ms status=200 bytes=3562 I have been

Sharing a lock between gunicorn workers

穿精又带淫゛_ 提交于 2019-12-17 16:46:18
问题 Is there a good way to share a multiprocessing Lock between gunicorn workers? I am trying to write a json API with Flask. Some of the API calls will interact a python class that manages a running process (like ffmpeg for video conversion). When I scale up my number of web workers to more than 1, how can I ensure that only 1 worker is interacting with the class at the same time? My initial thought was to use multiprocessing.Lock so the start() function can be atomic. I don't think I've figured

Make sure only one worker launches the apscheduler event in a pyramid web app running multiple workers

那年仲夏 提交于 2019-12-17 15:25:48
问题 We have a web app made with pyramid and served through gunicorn+nginx. It works with 8 worker threads/processes We needed to jobs, we have chosen apscheduler. here is how we launch it from apscheduler.events import EVENT_JOB_EXECUTED, EVENT_JOB_ERROR from apscheduler.scheduler import Scheduler rerun_monitor = Scheduler() rerun_monitor.start() rerun_monitor.add_interval_job(job_to_be_run,\ seconds=JOB_INTERVAL) The issue is that all the worker processes of gunicorn pick the scheduler up. We

Gunicorn Nginx timeout problem

我们两清 提交于 2019-12-17 06:29:25
问题 I'm running django on gunicorn+nginx. I'm facing a problem with file uploads. Actually uploads are working fine but gunicorn times out thus causing this in 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" If I refresh

gunicorn部署Flask服务

送分小仙女□ 提交于 2019-12-17 03:27:04
gunicorn部署Flask服务 作为一个Python选手,工作中需要的一些服务接口一般会用Flask来开发。 Flask非常容易上手,它自带的 app.run(host="0.0.0.0", port=7001) 用来调试非常方便,但是用于生产环境无论是处理高并发还是鲁棒性都有所欠缺,一般会配合WGSI容器来进行[生产环境的部署][1]。 小磊哥推荐了参考文章[1]中的部署方式,希望将已有的服务放到gunicorn或者Tornado中部署,并用supervisor来管理所有进程(有几个不同的服务)。 经过调研和尝试 gunicorn可以结合gevent来进行部署,因此在高并发场景下也可适用,于是决定采用gunicorn进行部署。 gunicorn和supervisor会有一定的冲突,即使gunicorn中没有设置为后台启动,supervisor也只会管理gunicorn的master进程; supervisor的重启服务对于无响应的Flask进程来说并不生效,不能很好地解决我的服务由于某些原因无法正常响应但又找不到方法解决的问题,因此暂时决定不用supervisor。 环境安装 首先pip安装gunicorn。 pip install gunicorn --user Tips. pip --user用法 由于是部署在公司云主机上,通常不会给root权限。之前都是提工单给SA

(13: Permission denied) while connecting to upstream:[nginx]

吃可爱长大的小学妹 提交于 2019-12-17 01:23:09
问题 I am working with configuring Django project with Nginx and Gunicorn. While I am accessing my port gunicorn mysite.wsgi:application --bind=127.0.0.1:8001 in Nginx server, I am getting the following error in my error log file; 2014/05/30 11:59:42 [crit] 4075#0: *6 connect() to 127.0.0.1:8001 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8001/" , host: "localhost:8080" Below is the

(13: Permission denied) while connecting to upstream:[nginx]

无人久伴 提交于 2019-12-17 01:22:31
问题 I am working with configuring Django project with Nginx and Gunicorn. While I am accessing my port gunicorn mysite.wsgi:application --bind=127.0.0.1:8001 in Nginx server, I am getting the following error in my error log file; 2014/05/30 11:59:42 [crit] 4075#0: *6 connect() to 127.0.0.1:8001 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8001/" , host: "localhost:8080" Below is the

web网站阿里云服务器项目部署

十年热恋 提交于 2019-12-16 10:51:14
项目部署 基于ubuntu 16.04系统,使用 Gunicorn + Nginx 进行布署 阿里云服务器控制台: https://www.aliyun.com https://ecs.console.aliyun.com/#/home 1、进入控制台,查看实例创建情况 2、给安全组配置规则,添加5000端口(一并加上5001端口) 3、利用命令行进行远程服务器登录 ssh 用户名@ip地址 相关环境安装 以下操作都在远程服务器上进行操作 (ubuntu 16.04) 1)先更新 apt 相关源 sudo apt-get update 2)mysql安装 apt-get install mysql-server apt-get install libmysqlclient-dev 3)redis安装 sudo apt-get install redis-server 4)安装虚拟环境 pip install virtualenv pip install virtualenvwrapper 使得安装的virtualenvwrapper生效,编辑~/.bashrc文件,内容如下: export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/workspace source /usr/local/bin