Questions tagged [uwsgi]

uWSGI is a fast, self-healing and developer/sysadmin-friendly application container server coded in pure C.

The uWSGI project

The uWSGI project aims at developing a full stack for building (and hosting) clustered/distributed network applications.

Mainly targeted at the web and its standards, it has been successfully used in a lot of different contexts.

Thanks to its pluggable architecture it can be extended without limits to support more platforms and languages. Currently, you can write plugins in C, C++ and Objective-C.

The “WSGI” part in the name is a tribute to the namesake Python standard, as it has been the first developed plugin for the project.

Versatility, performance, low-resource usage and reliability are the strengths of the project (and the only rules followed).

The uwsgi Protocol

The uwsgi (lowercase!) protocol is the native protocol used by the uWSGI server.

It is a binary protocol that can carry any type of data. The first 4 bytes of a uwsgi packet describe the type of the data contained by the packet.

Every uwsgi request generates an response in the uwsgi format.

Even the web server handlers obey this rule, as an HTTP response is a valid uwsgi packet (look at the modifier1 = 72).

The protocol works mainly via TCP but the master process can bind to a UDP Unicast/Multicast for The embedded SNMP server or cluster management/messaging requests.

2938 questions
38
votes
3 answers

uWSGI raises OSError: write error during large request

My application uses nginx, with uWSGI on the server side. When I do a large request (with a response time > 4s), the following appears: SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request _URL_ (ip…
JulCh
  • 2,710
  • 2
  • 19
  • 21
38
votes
3 answers

Django App Improperly Configured - The app module has multiple filesystem locations

I think I've really screwed something up. On my django app (the production one) I pushed a major update and am get an "Internal Server Error" whenever I try to go to my domain. I am getting an error in my uwsgi logs: *** Starting uWSGI 2.0.8 (64bit)…
Chase Roberts
  • 9,082
  • 13
  • 73
  • 131
38
votes
3 answers

uwsgi throws IO error caused by uwsgi_response_write_body_do broken pipe

My application is a uwsgi+django setup. I use gevent to do performance testing and run 1200 requests concurrently. At this point, uwsgi will throw an IO error with the following log message: uwsgi_response_write_body_do(): Broken pipe…
linbo
  • 2,393
  • 3
  • 22
  • 45
37
votes
8 answers

How to set up autoreload with Flask+uWSGI?

I am looking for something like uWSGI + django autoreload mode for Flask.
Florian
  • 2,562
  • 5
  • 25
  • 35
36
votes
1 answer

Difference between uwsgi_pass and proxy_pass in Nginx?

I'm running uWSGI behind Nginx and have been using proxy_pass to get Nginx to hit uWSGI. Is there any benefit to switch to uwsgi_pass. If so, what is it?
Eli
  • 36,793
  • 40
  • 144
  • 207
35
votes
8 answers

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding, when trying to start uwsgi

I am trying to start my uwsgi server in my virtual environment, but after I added plugin python3 option I get this error every time: !!! Python Home is not a directory: /home/env3/educ !!! Set PythonHome to /home/env3/educ Python path…
Denys
  • 539
  • 1
  • 6
  • 9
34
votes
3 answers

debugging a uwsgi python application using pycharm

Is it possible to debug a uwsgi application using an ide like PyCharm? I can debug flask based apps fine by running them directly from pycharm but cannot even run a uwsgi app from within pycharm. Do I have to use remote debugging? Is it possible to…
remudada
  • 3,751
  • 2
  • 33
  • 60
33
votes
1 answer

Gunicorn sends info message Handling signal: winch

Why does Gunicorn send info message Handling signal: winch when application is idle? There is no error, as the application continues to respond, but when it is idle, the above message is displayed. I could not find more information in Gunicorn…
BrB
  • 815
  • 1
  • 8
  • 13
33
votes
2 answers

uwsgi IOError: write error

I have a problem with my nginx+uwsgi configuration for my django app, I keep getting this errors in the uwsgi error log: Wed Jan 13 15:26:04 2016 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 296] during POST…
Virgil Balibanu
  • 1,037
  • 4
  • 11
  • 16
33
votes
5 answers

pip-installed uWSGI ./python_plugin.so error

I've installed uWSGI using pip and start it up with an XML to load my application. The XML config contains python. On my new server it leads to an error: open("./python_plugin.so"): No such file or directory [core/utils.c line…
Carst
  • 1,614
  • 3
  • 17
  • 28
32
votes
1 answer

tornado vs wsgi(with gunicorn)

I read this about Tornado: On the other hand, if you already have a WSGI app and want to run it on a blazing fast tornado.httpserver.HTTPServer, wraps it with tornado.wsgi.WSGIContainer. But you need to be careful. Since your original…
schemacs
  • 2,783
  • 8
  • 35
  • 53
31
votes
1 answer

X-Forwarded-Proto and Flask

I have precisely the same problem described in this SO question and answer. The answer to that question is a nice work around but I don't understand the fundamental problem. Terminating SSL at the load balancer and using HTTP between the load…
Ben Whaley
  • 32,811
  • 7
  • 87
  • 85
30
votes
4 answers

Failed building wheel for uwsgi

I got an error,Failed building wheel for uwsgi. My environment is Ubuntu,now I wanna install uwsgi,so I run command pip install uwsgi.But error happens Traceback (most recent call last): File "", line 1, in File…
user8817674
  • 1,001
  • 4
  • 12
  • 16
30
votes
3 answers

uWSGI: --master with --emperor spawns two emperors

I can see that if I start uwsgi like this: sudo /usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals --uid www --gid www it creates one emperor copy. But if I start it with --master additionally (as recommended here), it creates two emperor copies.…
clime
  • 8,695
  • 10
  • 61
  • 82
29
votes
2 answers

When is --thunder-lock beneficial?

This long, detailed, and entertaining article describes the history and design of --thunder-lock: http://uwsgi-docs.readthedocs.org/en/latest/articles/SerializingAccept.html But it doesn't help me decide when I need it! When is and isn't…
John Bachir
  • 22,495
  • 29
  • 154
  • 227