mod_perl 与 mod_fastcgi
我正在 Perl 中开发一个 Web 应用程序,其中需要一些 C 语言来进行一些繁重的数字运算。 到目前为止,我遇到的主要问题是尝试决定是否应该使用 mod-perl、mod-fastcgi 或两者来运行我的脚本,因为我很难分析每个 mod 的优缺点。
任何人都可以发布摘要或提供链接,我可以在其中找到一些比较信息,也许还可以找到一些带有示例的建议?
I'm developing a web app in Perl with some C as necessary for some heavy duty number crunching. The main problem I'm having so far is trying to decide if I should use mod-perl, mod-fastcgi or both to run my scripts because I'm having a difficult time trying to analyze the pros and cons of each mod.
Can anyone post a summary or give a link where I can find some comparison information and perhaps some recommendations with examples?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它们是完全不同的野兽。
mod_fastcgi(顺便说一句,推荐mod_fcgid)仅支持FCGI协议,通过一些旋钮来控制更快地执行CGI它会同时运行多少个进程,而不是更多。
另一方面,mod_perl 是一个用于开发应用程序的平台,它向您公开大多数 Apache 内部结构,以便您可以调整代码中的每个 Web 服务器旋钮、加速 CGI 以及 更多。
如果您希望快速运行 CGI,并希望支持尽可能多的主机,那么您应该坚持支持这两种方式来运行您的代码,并且可能还支持标准 CGI。
如果您关心以灵活性为代价的最大效率,您可以瞄准单一平台,可能是 mod_perl。
但最明智的选择可能是在任何地方运行并使用框架来构建应用程序,该应用程序将利用特定执行方式(如果存在)的优势,例如 催化剂。
They are quite different beasts.
mod_fastcgi (by the way, mod_fcgid is recommended) just supports the FCGI protocol to execute CGIs faster with some knobs to control how many processes will it run simutaneously and not much more.
mod_perl, on the other hand is a platform for development of applications that exposes most Apache internals to you so you can tweak every webserver knob from your code, accelerates CGIs, and much more.
If all you wish is to run your CGIs quickly, and want to support as many hosts as possible, you should stick with supporting those two ways to run your code and probably standard CGI as well.
If you care about maximum efficiency at the cost of flexibility, you could aim for a single platform, probably mod_perl.
But probably the sanest option is to run everywhere and use a framework to build the application that'll take care of using the advantages of a particular way of executing if present, like Catalyst.
我建议您使用 Catalyst 之类的框架来处理这些细节。 对于大多数应用程序来说,程序如何连接到网络服务器并不重要,只要以有效的方式完成即可。 mod_perl 和 FastCGI 之间的选择应该由部署它的系统管理员而不是开发人员做出。
I would advise you to use a framework such as Catalyst that takes care of such details. For most applications, it doesn't matter how the program connects to the webserver, as long as it is done in an efficient way. The choice between mod_perl and FastCGI should be made by the sysadmin who deploys it, not the developer.
这是一个网站,其中对 mod_perl、mod_fastcgi、cgi (Perl) 和 Java servlet 进行了一些实际性能比较 - 对于非常基本的脚本:https://sites.google.com/site/arjunwebworld/Home/programming/apache-jmeter
总之:
PerlMonks 上有一个旧线程比较 mod_perl 和fastcgi 在这里: http://www.perlmonks.org/?node_id=108008
Here is a site with some actual performance comparisons of mod_perl, mod_fastcgi, cgi (Perl) and a Java servlet - for a very basic script: https://sites.google.com/site/arjunwebworld/Home/programming/apache-jmeter
In summary:
There is an old thread on PerlMonks comparing mod_perl and fastcgi here: http://www.perlmonks.org/?node_id=108008