Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a speed difference between WSGI and FCGI?

From the web I've gleaned that WSGI is a CGI for python web development/frameworks. FCGI seems to be a more generalised gateway for a variety of languages. Don't know the performance difference between the two in reference to the languages python and C/++.

like image 806
torger Avatar asked Nov 17 '09 07:11

torger


People also ask

What is the difference between WSGI and CGI?

The WSGI application runs on the server, and acts as the interface between the server and web application written in a python. The CGI application runs on the server and processes requests passed by server.

How does Fast CGI work?

Basically, FastCGI is a program that manages multiple CGI requests within a single process, saving many program instructions for each request. Without FastCGI, each instance of a user requesting a service causes the Web server to open a new process that gets control, performs the service, and then is closed.


1 Answers

Correct, WSGI is a Python programmatic API definition and FASTCGI is a language agnostic socket wire protocol definition. Effectively they are at different layers with WSGI being a higher layer. In other words, one can implement WSGI on top of something that so happened to use FASTCGI to communicate with a web server, but not the other way around.

In general, FASTCGI being a socket wire protocol means that you always need some type of programmatic interface on top to use it. For Python one such option is WSGI. As FASTCGI is just a means to an end, one can't really compare its performance to WSGI in that case because WSGI isn't a comparable socket wire protocol, but a user of FASTCGI itself.

One could try and compare performance of different language interfaces on top of FASTCGI, but in general that is quite meaningless in itself as the lower network layer and server request handling aren't the bottleneck. Instead your application code and database will be.

like image 132
Graham Dumpleton Avatar answered Oct 07 '22 22:10

Graham Dumpleton