WSGI和FCGI之间有速度差异吗? [英] Is there a speed difference between WSGI and FCGI?

查看:96
本文介绍了WSGI和FCGI之间有速度差异吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从网络上收集到WSGI是python网络开发/框架的CGI. FCGI似乎是针对多种语言的更通用的网关.参照python和C/++语言,不知道两者之间的性能差异.

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/++.

推荐答案

正确的是,WSGI是Python编程API定义,而FASTCGI是与语言无关的套接字协议定义.实际上,它们位于不同的层次,而WSGI是更高的层次.换句话说,人们可以在使用FASTCGI与Web服务器通信的过程之上实现WSGI,但是反之则不行.

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.

通常,FASTCGI是套接字协议,这意味着您始终总是需要某些类型的编程接口才能使用它.对于Python,这样的选项之一就是WSGI.由于FASTCGI只是达到目的的一种手段,因此无法真正将其性能与WSGI进行比较,因为WSGI不是可比较的套接字协议,而是FASTCGI本身的用户.

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.

人们可以尝试在FASTCGI之上比较不同语言界面的性能,但是总的来说,这本身就毫无意义,因为较低的网络层和服务器请求处理并不是瓶颈.取而代之的是您的应用程序代码和数据库.

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.

这篇关于WSGI和FCGI之间有速度差异吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆