csrgxtu / Cocoa

A flask like framework implemented from inside out
1 stars 0 forks source link

WSGI, wsgi, uwsgi #1

Open csrgxtu opened 7 years ago

csrgxtu commented 7 years ago

need to figure out the relations between WSGI, wsgi, uwsgi.

csrgxtu commented 7 years ago

WSGI

Web server gateway interface, is a protocol between web server and web application in Python, to use this, both server and application need to implement the protocol in their side. For example, if Django application will contain a wsgi.py file, this is the client side implementation. and Guinicore is a server side implementation.

wsgi

wsgi is a python module that implements the server side WSGI protocol, it is mainly used to developement. like wsgiref, which is a reference(PEP 3333) implementation.

It also like gunicore, but don't use it in production env.

uWSGI and uwsgi

uWSGI is actually much more than a WSGI compatible web server, it also contains gateway functionality, load banlancer etc. but basicly, you can use it as a WSGI server just like Gunicore.

and uwsgi is a protocol implemented in uWSGI. normally when you start your application with uWSGI, uWSGI will listen on a local http port, and then there will be a Ningx proxy. the connection between Nginx and uWSGI is http. as we know, compares to socket, http is a little heavy, so uWSGI implemented a protocol based tcp socket, to make it more efficient.

Summary

WSGI is a protocol, uWSGI, wsgi, wsgiref, Gunicore is a Web server which compatible with WSGI protocol. and uwsgi is a local protocol used in uWSGI.