[Catalyst] Catalyst for (really) big applications

Matt S Trout dbix-class at trout.me.uk
Fri May 19 13:47:02 CEST 2006


ian docherty wrote:
> Marcello Romani wrote:
>> Brandon Black ha scritto:
>>   
>>> On 5/18/06, ian docherty <ian at ecisecurity.com> wrote:
>>>     
>>>> The reason I ask this is because all of the application is loaded into
>>>> memory when it starts (is this strictly correct?) so there is going to
>>>> be a limit in the size of the application limited by, presumably, the
>>>> amount of memory in the system.
>>>>       
>>> I suspect that the general rule would be that the amount of memory
>>> available on reasonably-priced modern hardware so vastly exceeds the
>>> neccesary RAM for storing the code of a Catalyst application that this
>>> shouldn't be an issue.
>>>     
>>
>> I recently deployed an intranet application with about 40/50 modules (I 
>> don't have the code right now and I don't remember the exact number) on 
>> a windows server, under Apache 2.0.5x.
>> The two apache processes take up almost 200mb of ram just before the 
>> first request. This value grows up to more than 250MB after list()ing 
>> some tables (with paging).
>>   
> Thank you, this is the sort of information I have been after. Now, does 
> anyone know if this is likely to grow linearly with the number of modules?

I'd note that that's on windows, which means apache will be using threading, 
which means you're looking at perl threading which is a full interpreter clone 
(remember perl threads are *really* shared-nothing). On a *n?x box provided 
you load all your modules before fork you're going to get a fair amount of 
copy-on-write at the VM level so your memory usage may not be nearly that high 
- and for large applications you'd want to use a custom-built perl without 
ithreads enabled at all, which will drop the memory usage again.

I've seen smaller Catalyst apps on *n?x with a sensible perl compile only 
using about 10-15Mb on startup, so I think the savings are probably pretty 
noticeable; your best bet would probably be to fire up the test server and 
check its memory usage at various points during development and check that as 
you go; the increase *will* be linear but how much of the base usage is 
Catalyst itself plus supporting modules is a different matter.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list