FAQ
Hi.


I was wondering what peoples thoughts are on what a good way to deploy
"many" (2-10, nothing extreme; different) Catalyst-based apps on a
single machine would be.

My first thought was that mod_perl perhaps in this case would be
preferable to FastCGI, because each process then would share the common
perl modules of the various frameworks (Catalyst, ORM, templating, etc.)
used by all the Catalyst apps, thereby saving a bit or two.

Does that compute, or, what did I overlook?

(Speed isn't really of the essense - these are rather small, personal
sites, traffic and otherwise, but I wouldn't want to "waste" RAM simply
by choosing a bad setup for this scenario).

(Also, the machine in question must run Apache anyway).


Best regards,

Adam

--
"Money always takes the place of life" Adam Sj?gren
asjo@koldfront.dk

Search Discussions

  • Matt S Trout at May 15, 2007 at 8:26 pm

    On Tue, May 15, 2007 at 06:52:06PM +0200, Adam Sj?gren wrote:
    I was wondering what peoples thoughts are on what a good way to deploy
    "many" (2-10, nothing extreme; different) Catalyst-based apps on a
    single machine would be.

    My first thought was that mod_perl perhaps in this case would be
    preferable to FastCGI, because each process then would share the common
    perl modules of the various frameworks (Catalyst, ORM, templating, etc.)
    used by all the Catalyst apps, thereby saving a bit or two.
    Or you could stuff 'em all in one fcgi handler with something like -

    package DummyApp;

    use Catalyst;

    __PACKAGE__->setup;

    my %rev_apps = (
    MyApp => 'myapp.example.com',
    MyOtherApp => 'other.example.com,
    );

    my %apps = reverse %rev_apps;

    foreach my $app (values %apps) {
    eval "require ${app}" || die $@;
    $app->engine(__PACKAGE__->engine);
    }

    sub handle_request {
    my ($self, %rest) = @_;
    my $host = $rest{env}{HTTP_HOST};
    $apps{$host}->handle_request(%rest);
    }

    --
    Matt S Trout Need help with your Catalyst or DBIx::Class project?
    Technical Director Want a managed development or deployment platform?
    Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
    http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
  • Ian Docherty at May 15, 2007 at 9:48 pm

    Matt S Trout wrote:
    Or you could stuff 'em all in one fcgi handler with something like -

    package DummyApp;

    use Catalyst;

    __PACKAGE__->setup;

    my %rev_apps = (
    MyApp => 'myapp.example.com',
    MyOtherApp => 'other.example.com,
    );

    my %apps = reverse %rev_apps;

    foreach my $app (values %apps) {
    eval "require ${app}" || die $@;
    $app->engine(__PACKAGE__->engine);
    }

    sub handle_request {
    my ($self, %rest) = @_;
    my $host = $rest{env}{HTTP_HOST};
    $apps{$host}->handle_request(%rest);
    }
    What would you suggest for multiple instances of the same application?

    MyApp => 'first.example.com'
    MyApp => 'second.example.com'

    I presume there would be no choice in this case but to use an fcgi
    handler for each one and mod-perl can't be used at all in this case?

    Regards
    Ian Docherty
  • Perrin Harkins at May 15, 2007 at 10:15 pm

    On 5/15/07, Ian Docherty wrote:
    What would you suggest for multiple instances of the same application?

    MyApp => 'first.example.com'
    MyApp => 'second.example.com'

    I presume there would be no choice in this case but to use an fcgi
    handler for each one and mod-perl can't be used at all in this case?
    It seems like most applications should support that with no problem.
    The only time it's an issue is when you want to run separate versions
    of the same module in each one, i.e. Foo.pm is different under the
    first and second. Or if you used package variables for data that
    should have been instance specific.

    The standard solution for mod_perl in that case would be to run a
    separate mod_perl backend for each, essentially the same as for FCGI.

    - Perrin
  • Matt S Trout at May 15, 2007 at 11:00 pm

    On Tue, May 15, 2007 at 09:48:44PM +0100, Ian Docherty wrote:
    Matt S Trout wrote:
    Or you could stuff 'em all in one fcgi handler with something like -

    package DummyApp;

    use Catalyst;

    __PACKAGE__->setup;

    my %rev_apps = (
    MyApp => 'myapp.example.com',
    MyOtherApp => 'other.example.com,
    );

    my %apps = reverse %rev_apps;

    foreach my $app (values %apps) {
    eval "require ${app}" || die $@;
    $app->engine(__PACKAGE__->engine);
    }

    sub handle_request {
    my ($self, %rest) = @_;
    my $host = $rest{env}{HTTP_HOST};
    $apps{$host}->handle_request(%rest);
    }
    What would you suggest for multiple instances of the same application?

    MyApp => 'first.example.com'
    MyApp => 'second.example.com'

    I presume there would be no choice in this case but to use an fcgi
    handler for each one and mod-perl can't be used at all in this case?
    Until 5.80, yes. Then we'll have something a little cooler for you :)

    --
    Matt S Trout Need help with your Catalyst or DBIx::Class project?
    Technical Director Want a managed development or deployment platform?
    Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
    http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
  • Nathaniel Nuss at May 16, 2007 at 3:49 am

    On Tue, May 15, 2007 at 06:52:06PM +0200, Adam Sj?gren wrote:
    Hi.


    I was wondering what peoples thoughts are on what a good way to deploy
    "many" (2-10, nothing extreme; different) Catalyst-based apps on a
    single machine would be.

    [...]
    On a different track ... virtualization

    At $work we've been pleased with running (and developing) a handful of apps in
    linux vservers.

    --
    Nate Nuss

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMay 15, '07 at 5:52p
activeMay 16, '07 at 3:49a
posts6
users5
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase