I know uwsgi is the protocol implemented in uWSGI server. But what changes does it have as compared to wsgi?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With