多个与单个催化剂应用 [英] Multiple vs. single Catalyst applications

查看:52
本文介绍了多个与单个催化剂应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个 Catalyst 应用程序作为 FCGI 运行.

I have multiple Catalyst applications running as FCGI.

将它们合并为具有多个控制器的单一控制器是否有好处?

Is there a benefit in consolidating them into a single one with multiple constrollers?

谢谢,

西蒙

推荐答案

RAM,大概?我认为每台服务器至少要保持大约 15MB,所以如果你用 3 个服务器运行 3 个应用程序,你可能可以节省大约 100MB 的空间.但这纯粹是餐巾纸猜测的背后.

RAM, probably? I think the minimum each server is going to hold onto is about 15MB so you might be able to save something like 100MB if you’re running 3 apps with with 3 servers. But that’s pure back of the napkin speculation.

另一个可能实现大部分相同节省的选择是转移到 Plack 部署.例如,相同的三个应用程序,未经整合,部署在同一台服务器上(未经测试,但似乎是正确的)–

Another option, which would likely achieve most of the same savings would be to move to Plack deployment. E.g., the same three apps, without consolidation, deployed on the same server (this is untested but seems right)–

# file: mutli-app.psgi
use Plack::Builder;

use YourApp;
use OurApp;
use MyApp;

MyApp->setup_engine('PSGI');
my $mine = sub { MyApp->run(@_) };

YourApp->setup_engine('PSGI');
my $your = sub { YourApp->run(@_) };

OurApp->setup_engine('PSGI');
my $our = sub { OurApp->run(@_) };

builder {
    mount "/mine" => builder {
        enable "Plack::Middleware::Foo";
        $mine;
    };
    mount "/secondperson" => $your;
    mount "/shared" => $our;

};

然后运行它 -

plackup multi-app.psgi

这篇关于多个与单个催化剂应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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