[Catalyst] Deployment of many Catalyst sites on the same machine
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 [EMAIL PROTECTED] ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Deployment of many Catalyst sites on the same machine
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 DirectorWant 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/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Deployment of many Catalyst sites on the same machine
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 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Deployment of many Catalyst sites on the same machine
On 5/15/07, Ian Docherty <[EMAIL PROTECTED]> 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 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Deployment of many Catalyst sites on the same machine
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 DirectorWant 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/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Deployment of many Catalyst sites on the same machine
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 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/