uwsgi

uwsgi segmentation fault for one specific route

本小妞迷上赌 提交于 2019-12-10 20:52:00
问题 My django apps works correctly locally, but when I deployed it facing a uswgi seg fault for one specific route. Every others routes works correctly. Here the view: def bunny(request): """ Filter crawler, bot and real user :param request: :return: serve rendered page to crawler / SPA to user """ ......some other codes .... path = request.get_full_path_info() if path.startswith('/news_paper'): # <<-- seg fault for this routes only in production server news_paper = utils(unquote(path[12:])) if

uWSGI+Flask+boto - thread safety

≯℡__Kan透↙ 提交于 2019-12-10 20:09:10
问题 Say I have a Flask application, served by uWSGI using multiple processes, like: uwsgi --socket 127.0.0.1:3031 --file flaskapp.py --callable app --processes 4 And my Flask app is organized like this: /flaskapp app.py /db __init__.py somefile.py somefile2.py ... And I'm using boto to connect to DynamoDB. The __init__.py file is empty, and each somefilexxx.py file begins something like this: db = boto.connect_dynamodb() table = db.get_table('table') def do_stuff_with_table(): I don't use threads

Configuring Nginx server to python flask application

浪尽此生 提交于 2019-12-10 19:18:47
问题 i am new to configuring server. And i want to configure my Amazon-EC2 instance. I configured it according to this document. http://www.soundrenalin.com/about However when i click the url, 502 Bad Gateway error is being encountered. My project is located at this path: /home/ubuntu/dsn/app . And the /home/ubuntu/dsn folder tree is: app/ app.py static/ templates/ themes/ bin/ build/ include/ lib/ local/ run.py Here is my nginx config ( /etc/nginx/sites-available/default ): server { listen 80;

Why does multiprocessing work on Django runserver and not on ngnix uwsgi?

喜夏-厌秋 提交于 2019-12-10 17:22:14
问题 I have a Django 1.6 using python3.3 application which receives an http request, does short term work, starts a new process and returns in a matter of 2 seconds. The process typically takes 50-60 seconds at which time it writes that the data is free on the data base where a timed ajax call can retrieve the data and update the clint web page. This works perfectly on the Django development runserver. When I deploy the application on ngnix uwsgi the quick response is delayed for 50-60 seconds and

uWSGI set configuration depending on environment variable

瘦欲@ 提交于 2019-12-10 16:26:15
问题 Please help me understand uWSGI configuration logic. I have an environment variable ENVIRONMENT . Let's say its values can either be dev or prod . I want to set configuration options based on value of ENVIRONMENT # always executes print statement, doesn't matter what ENVIRONMENT is set to if-env= ENVIRONMENT if-opt: %(_)=dev print = RUNNING %(_) endif: endif = # always executes print statement, doesn't matter what ENVIRONMENT is set to running = ENVIRONMENT if-opt: running=dev print = RUNNING

nginx django 502 bad gateway

二次信任 提交于 2019-12-10 14:15:30
问题 I am using uWSGI and Nginx to server up my Django website (1.4 version). My file structure is django_mysite/django_mysite/ in which there is a wsgi.py file. I keep getting 502 Bad gateway errors. I have other servers running of nginx and they are working fine. My nginx config: server { listen 80; server_name beta.example.com; keepalive_timeout 70; root /path/to/django_mysite/django_mysite; location root { root html; uwsgi_pass localhost:9000; uwsgi_param UWSGI_SCRIPT django_wsgi; include

uwsgi cheaper killing workers processing requests

我是研究僧i 提交于 2019-12-10 10:50:05
问题 I have a very basic flask application under uwsgi, managed by signals under supervisorctl. I use cheaper for scaling workers and ran into very disturbing situation. uwsgi is killing oldest worker, even when it is processing a request, causing 500. How to prevent uwsgi from killing workers processing the request, for the sake of cheaping? Any help/hints deeply appreciated. Found another similar post without response: UWSGI killing workers too fast Config: uwsgi version: 2.0.4 # Auto-scaling

Python Flask server crashing on GET request to specific endpoint:

僤鯓⒐⒋嵵緔 提交于 2019-12-10 10:44:15
问题 All, I have an API with two endpoints built using Flask. I am using an nginx/uwsgi combo for serving and I am getting an odd error whenever I send a GET request to one of the end points. The other endpoint works just fine. Here is the output from my uwsgi log from a get request File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1646, in request_context return RequestContext(self, environ) File "/usr/local/lib/python2.7/dist-packages/flask/ctx.py", line 166, in __init__ self.url

nginx+uwsgi+django, there seems to be some strange cache in uwsgi, help me

爱⌒轻易说出口 提交于 2019-12-10 07:14:23
问题 This is uwsgi config: [uwsgi] uid = 500 listen=200 master = true profiler = true processes = 8 logdate = true socket = 127.0.0.1:8000 module = www.wsgi pythonpath = /root/www/ pythonpath = /root/www/www pidfile = /root/www/www.pid daemonize = /root/www/www.log enable-threads = true memory-report = true limit-as = 6048 This is Nginx config: server{ listen 80; server_name 119.254.35.221; location / { uwsgi_pass 127.0.0.1:8000; include uwsgi_params; } } The django works ok, but modifed pages can

How to separate logs of uWSGI?

别来无恙 提交于 2019-12-10 04:24:43
问题 I want to separate the logs of uwsgi like access logs, request logs, error logs in individual files. At the moment these all are in same file and not well formatted. 回答1: There are configuration directives to specify different loggers for requests and all other messages: logger and req-logger . Example: # uwsgi.ini req-logger = file:/var/log/uwsgi/uwsgi-req.log logger = file:/var/log/uwsgi/uwsgi.log If you want nondefault formatting, filtering or a peculiar output location, you could write