Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between uwsgi protocol and wsgi protocol?

Tags:

uwsgi

wsgi

I know uwsgi is the protocol implemented in uWSGI server. But what changes does it have as compared to wsgi?

like image 416
Vipul Patil Avatar asked Aug 04 '12 19:08

Vipul Patil


People also ask

What is 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 a response in the uwsgi format.

What is the difference between Nginx and uWSGI?

Nginx is “a web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache”. uWSGI is an implementation of the WSGI spec, which describes how a web server should communicate with a web app, which makes uWSGI also a type of web server.

Is uWSGI a framework?

In addition to the caching framework, uWSGI includes a shared queue. At the low level it is a simple block-based shared array, with two optional counters, one for stack-style, LIFO usage, the other one for FIFO.

Which is better Gunicorn or uWSGI?

Both can reach very impressive levels of performance, though some have mentioned that Gunicorn works better under high load. Drawbacks to Gunicorn are much the same as uWSGI, though I personally have found Gunicorn to be more easily configurable than uWSGI.


1 Answers

The uwsgi protocol is a wire protocol used over the socket between processes with uWSGI. It cannot be compared to WSGI, which is a programmatic API for Python. The uwsgi protocol is more akin to FASTCGI, or SCGI. It is language agnostic. From memory there is very little difference between it and SCGI.

In short, that uwsgi has the name 'wsgi' in it was a bad idea as it is actually unrelated to WSGI. You still need an adapter to get from uwsgi to Python WSGI. In the case of uWSGI that is written as C code and embedded in uWSGI. One could write an adapter between uwsgi and other language APIs for web applications as well and uWSGI internal also has such things.

like image 59
Graham Dumpleton Avatar answered Sep 22 '22 10:09

Graham Dumpleton