We have concurrent issues in Python. These WSGI Servers just do not work that wonderful. I have a look around, get nothing like a Golang written WSGI Server with its goroutines.
Any reasons?
We have concurrent issues in Python. These WSGI Servers just do not work that wonderful. I have a look around, get nothing like a Golang written WSGI Server with its goroutines.
Any reasons?
WSGI
protocol is specific to Python. With Go you have three options (actually, four, but plain CGI
should supposedly be not considered for moderate to high load setups):
Built-in HTTP
serving facilities of Go's standard library.
In this case your app is a standalone server. This might be the simplest setup but it might have the following problems:
goagain
).Same as above, but behind a reverse HTTP
proxy in the form of a web server.
Mostly removes the problems of the standalone variant but still have the overhead of passing full HTTP
traffic back and forth.
FastCGI
via a suitable webserver. Nginx
and Apache
(and numerous others) are okay with this. FCGI
client implementation is available in the Go standard library.
In addition to not having the problems of the standalone setup, implements a more efficient data exchange protocol. Another bonus is that your Go server might communicate with the front-end web server using Unix pipes which have less transmission cost than TCP sockets involved in the reverse HTTP
proxy variant.
So, if your setup currently uses WSGI
, I'd say go with FCGI
.