我应该使用什么标准来评估 Perl“应用程序服务器"?(mod_perl 替换)? [英] What criteria should I use to evaluate a Perl "app server" (mod_perl replacement)?

查看:61
本文介绍了我应该使用什么标准来评估 Perl“应用程序服务器"?(mod_perl 替换)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简短版本:

我应该使用什么标准来评估 Perl应用服务器"(mod_perl 替换)的可能候选者?

我们正在寻找某种框架,它允许重复执行各种 Perl 程序(作为服务),而无需花费:

We are looking for some sort of framework which will allow executing various Perl programs repeatedly (as a service) without the costs of:

  1. 每次执行重新启动 perl 解释器一次

  1. re-launcing perl interpreter once per each execution

每次执行加载/编译 Perl 模块一次

loading/compiling Perl modules once per execution

(这两个都是运行 mod_perl 的好处)

(both of which are the benefits that running mod_perl provides)

注意事项:

  • 我们不太关心 mod_perl 提供的任何额外好处,例如深度 Apache 集成.

  • We do NOT much care about any additional benefits afforded by mod_perl too much, such as deep Apache integration.

这将是一个纯粹的应用服务器,这意味着不需要任何特定于 Web 的功能(如果应用服务器提供它就没有问题,只是不需要).

This will be a pure app server, meaning there is no need for any web specific functionality (it's not a problem if the app server provides it, just won't be needed).

我们当然会考虑明显的标准(原始速度、生产就绪稳定性、积极开发、在我们关心的操作系统上运行的能力).我感兴趣的是我们可能希望从这样的框架/服务器中获得不那么琐碎和微妙的东西.

We will of course consider the obvious criteria (raw speed, production-ready stability, active development, ability to run on OSs we care about). What I'm interested in is less trivial and subtle things that we may wish from such a framework/server.

背景:

在 $work,决定他们想要取代当前情况的权力(在 Embperl 中开发并通过 Apache/mod_perl 部署的简单 web 应用程序).

At $work, the powers that be decided that they want to replace a current situation (simple webapps being developed in Embperl and deployed via Apache/mod_perl).

决定使用一个(本土的)MVC 系统,该系统将为 View 提供一个 Java Spring 前端;并且控制器将解析后端服务请求到执行模型职责的每个应用程序服务(不要挂在这个细节上 - 它与主要问题不是很相关).

The decision was made to use a (home-grown) MVC system that will have a Java Spring front end for the View; and the Controller will parsel out back-end service requests to per-app services that perform Model duties (don't get hung up on details of this - it's not very relevant to the main question).

后端服务的一个选项是 Perl,这样我们就可以利用我们所有现有的 Perl IP(库、webapp 后端代码),而不必将其 100% 移植到 Java.

One of the options for back-end services is Perl, so that we can leverage all our existing Perl IP (libraries, webapp backend code) going forward, and not have to port 100% of it to Java.

总结:

    | View    | Model/app | Model loaded/executed by:                          |
================================================================================
OLD | Empberl | Model.pm | mod_perl has Model.pm loaded, called from view.epl  |
NEW | Java    | Model.pm | perl generic_model.pl -model Model (does "require") |
================================================================================

现在,那些做过一段时间 Perl Web 开发的人会立即注意到新设计中最明显的问题:

Now, those of you who did Perl Web development for a while, will immediately notice the most glaring problem with the new design:

    | Perl interpreter starts  | Perl modules are loaded and compiled |
=======================================================================
OLD | Once per mod_perl thread | Once per mod_perl thread
NEW | Once per EVERY! request  | Once per EVERY! request              |
=======================================================================

换句话说,在新模型中,我们不再拥有 mod_perl 作为持久服务器端应用程序容器提供的任何性能优势!!!

In other words, in the new model, we no longer have any performance benefits afforded by mod_perl as a persistent server side app container!!!

因此,我们正在寻找可能的应用容器来提供相同的功能.

Therefore, we are looking at possible app containers to serve the same function.

(作为旁注,是的,我们考虑过简单地使用 mod_perl 作为这样的应用程序容器运行 Apache 实例,这是一种可行的可能性.但是,由于不需要 Web 功能,我想看看是否有其他选项可能符合要求).

(as a side note, yes, we thought about simply running an instance of Apache with mod_perl as such an app container, as a viable possibility. However, since web functionality is not required, I'd like to see if any other options may fit the bill).

推荐答案

Starman is a High-可以在该上下文中使用的性能预分叉 PSGI/Plack Web 服务器.构建一个为无状态 JSON 对象提供服务的 REST 应用程序很容易(这是一个简单的用例).

Starman is a High-performance preforking PSGI/Plack web server that may be used in that context. It's easy to build a REST application that serves stateless JSON objects (this is a simple use case).

Starman 是一个生产就绪的服务器,在反向代理后面安装一组 Starman 实例真的很容易(这个问题可能对您有帮助),用于扩展目的

Starman is a production-ready server and it's really easy to install a set of Starman instances behind a reverse-proxy (this SO question may helps you), for scaling purposes

这篇关于我应该使用什么标准来评估 Perl“应用程序服务器"?(mod_perl 替换)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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