Multiple vs. single Catalyst applications

左心房为你撑大大i 提交于 2019-12-06 11:36:28

问题


I have multiple Catalyst applications running as FCGI.

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

Thanks,

Simone


回答1:


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.

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;

};

And then run it with–

plackup multi-app.psgi


来源:https://stackoverflow.com/questions/5429052/multiple-vs-single-catalyst-applications

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!