我有一个使用nginx,uWSGI和Django构build的API的web应用程序。 最近我在一个特定的API调用中看到了很多harakiris,它会进行一些快速处理,然后产生一些线程来处理一些长时间运行的函数。 主线程然后返回并且工作线程将其结果存储在caching中并退出。 在线程产生之后,它们之间没有交互。 我的uWSGI在20秒内被设置为harakiri。 这应该是足够的时间让主线程完成并返回(平均大约2-3秒)。 uWSGI是否有可能因为我的工作线程太长而返回? 如果是这样,我可以解决这个问题,而不是multithreading在python中的多处理? 谢谢!
主pipe可以启动uwsgi,但停止uwsgi后,当我尝试再次启动它,我得到这个错误: 2014-03-16 08:38:34,249 DEBG 'app' stderr output: thunder lock: disabled (you can enable it with –thunder-lock) 2014-03-16 08:38:34,249 DEBG 'app' stderr output: probably another instance of uWSGI is running on the same address (127.0.0.1:8001). 2014-03-16 08:38:34,249 DEBG 'app' stderr output: bind(): Address already in use [core/socket.c line 759] 2014-03-16 08:38:34,250 DEBG fd 11 closed, stopped […]
我试图用uwsi来使用nginx。 我写了uwsgi ini文件,并用uwsgi –ini site.ini进行testing 一切工作正常。 但是,当我尝试运行该网站时,我得到了以下错误(从日志文件): *** Python threads support is disabled. You can enable it with –enable-threads$ Python main interpreter initialized at 0x1a297d0 your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 800360 bytes (781 KB) for 10 cores *** Operational […]
更新:我看到与/ tmp目录相关的问题,以及提到的将注释从/ home移出的注释。 它没有解决这个问题。 (在post底部的附加更新) 我有一个azure色的Ubuntu 16.04虚拟机我正在使用主机使用uwsgi作为服务器和nginx作为反向代理的烧瓶应用程序,按照本指南… https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-16-04 问题是我得到一个502错误的网关,当我尝试连接到服务器的IP在端口80上的Web浏览器。当我检查日志,它说,Nginx无法find我在configuration文件中指定的Unix套接字。 错误是… 2016/08/29 23:23:20 [crit] 2792#2792: *120 connect() to unix:///home/me/appname/appname/appname.sock failed (2: No such file or directory) while connecting to upstream, client: ip.goes.in.here, server: here.goes.the.ip, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:///home/me/appname/appname/appname.sock:", host: "the.ip.goes.here", referrer: "http://all.of.teh.ips/" 我的服务器块看起来像这样… server { listen 80; server_name ip.address.goes.here; location / { include uwsgi_params; […]
首先我通过apt-get安装nginx和uwsgi。 而且,我将这行添加到nginx conf文件(/etc/nginx/conf.d/default.conf)中,如下面的行; server { listen 80; server_name <replace with your hostname>; #Replace paths for real deployments… access_log /tmp/access.log; error_log /tmp/error.log; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:8889; } } 我有一个错误; Starting nginx: [emerg]: open() "/etc/nginx/uwsgi_params" failed (2: No such file or directory) in /etc/nginx/conf.d/default.conf:11 configuration file /etc/nginx/nginx.conf test failed 如果我从uwsgi的源代码中添加uwsgi_params文件;我有一个简单的错误。 谢谢
我正在运行一个数据库支持的网站,收到很less的stream量。 然而,一天或两天,请求将会超时,我会在Nginx的error.log看到这个(或类似的)错误: 2013/06/13 18:32:40 [error] 16723#0: *27796 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 199.71.215.214, server: app.mypythonwebapp.com, request: "POST /api?submit_staker_response HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi/app.mypythonwebapp.com-uwsgi.sock", host: "app.mypythonwebapp.com", referrer: "https://app.mypythonwebapp.com/survey/5/791/70ea73eb9a489f2dead804a95c400ab2" 我正在运行uWSGI,在它的日志文件中没有任何与此相关的东西(我可以告诉)。 我怀疑它可能是PostgreSQL相关的,但如果我通过pg_stat_activity检查它的状态,我什么都看不到。 这是我的uWSGI YAMLconfiguration文件: uwsgi: socket: /var/run/uwsgi/%n-uwsgi.sock workers: 5 buffer-size: 32768 callable: app wsgi-file: /opt/sites/app.mypythonwebapp.com/run.py virtualenv: /opt/virtualenv/app.mypythonwebapp.com pythonpath: /opt/sites/app.mypythonwebapp.com 我所在的服务器有两个(虚拟化的)核心,所以我做了1 +核心* […]
我试图find一个最佳的方式来设置我的服务器使用NGINX和UWSGI服务python应用程序。 以下工作到目前为止: 初始设置: sudo apt-get install nginx uwsgi uwsgi-plugin-http uwsgi-plugin-python python-setuptools easy_install pip pip install web.py 在/ etc / nginx的/网站可用/默认: server { listen 80; server_name localhost; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9090; } } 然后我有一个基本的myapp.py(位置不关心当前的设置): import web urls = ( '/', 'index' ) app = web.application(urls, globals()) class index: def GET(self): return "Hello from […]
uwsgi config中的reload-on-as和evil-reload-on-as选项之间有什么区别? 我使用reload-on-as和uwsgi worker仍然消耗无限的内存,并在任务完成时重新加载。 当为了debugging目的而消耗有限的内存时,我需要杀死工作者。 什么是最好的办法呢? 可能是限制选项?
我尝试重新启动生产项目,并停止工作。 这是一个django == 1.5.1和django-cms == 2.4.1的项目。 我重新启动,因为我已经从django == 1.4.1项目更新到django == 1.5.1,但只要我知道它不会改变wsgi.ini中的任何东西。 当我第一次重新加载这个项目的时候,它正在发生一个500错误。 然后我决定删除我的/tmp/zecaffe.sock重新创build它,然后重新启动项目,现在当我看到里面我的error_zecaffe.log它显示这个错误: 2013/05/03 16:16:35 [crit] 32378#0: *207 connect() to unix:///tmp/zecaffe.sock failed (2: No such file or directory) while connecting to upstream, client: 189.75.17.67, server: zecaffe.infalms.com.br, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///tmp/zecaffe.sock:", host: "zecaffe.infalms.com.br" 2013/05/03 16:16:36 [crit] 32378#0: *207 connect() to unix:///tmp/zecaffe.sock failed (2: No […]
我跟着这个post来服务我的Django项目。 该项目与manage.py runserver运行服务器运行良好,我想设置为生产。 这是我的设置文件: nginx.conf : upstream django { server /tmp/vc.sock; #server 10.9.1.137:8002; } server { listen 8001; server_name 10.9.1.137; charset utf-8; client_max_body_size 25M; location /media { alias /home/deploy/vc/media; } location /static { alias /home/deploy/vc/static; } location / { uwsgi_pass django; include /etc/nginx/uwsgi_params; } } uwsgi.ini : [uwsgi] chdir = /home/deploy/vc wsgi-file = vc/wsgi.py master […]