[Catalyst] Running multiple instances on an application

Matt S Trout dbix-class at trout.me.uk
Sat Nov 15 19:55:58 GMT 2008


On Tue, Nov 04, 2008 at 01:24:22PM +0100, Christian Lackas wrote:
> Hi Everybody,
> 
> I would like to have multiple (20-50) instances of a Catalyst
> application running using FastCGI. Since this would result in quite a
> few preforked processes, I wondered if it is possible to just use one
> set of FastCGI processes and have different config files for different
> domain names.  In the configuration I would then have the connect string
> for the different database, local folders, etc...

Not out of the box but with ACCEPT_CONTEXT on your model (see
Catalyst::Component::InstancePerContext for a nice wrapper for this) it
shouldn't be too difficult.

> Can I re-load a config file at the very beginning of request handling?
> And does a Catalyst::Model::DBIC re-connect for every request or keep
> the connection open for the life-time of the process?

Lifetime of the process by default but that's because the DBIC $schema
lasts the lifetime of the process. If you have your own per-context stuff
then you can control the lifetime however you like.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list