Multiple vs. single Catalyst applications

2020-07-27 02:13发布

I have multiple Catalyst applications running as FCGI.

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

Thanks,

Simone

标签: perl catalyst
1条回答
叼着烟拽天下
2楼-- · 2020-07-27 03:03

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
查看更多
登录 后发表回答