[Catalyst] Re: memory usage of mod_perl process

Brian Kirkbride brian.kirkbride at deeperbydesign.com
Thu Feb 8 19:16:05 GMT 2007


Jeffrey Ng wrote:
> I am the coworker of Fayland who posted the topic "memory usage of 
> mod_perl process".
> 
> Our company has invested quite some time on migrating our perl code to 
> catalyst (more than half year of time by 7 programmers). However, I am 
> starting to worry that moving to catalyst is causing too much overhead 
> for our processes and thus severely slowing down our site.
> 
> I remember the memory usage of each process before catalyst was around 
> 25Mb. And now the new code is using around 90MB as fayland said. During 
> peak hour, our servers were able to handle 30+ requests per sec before 
> catalyst upgrade. Now we are only able to handle around 10 requests per 
> sec.
> 
> As a result, the response time of the site is much slower after the 
> upgrade. it takes at least 2 sec for the browser to start responding 
> during non-peak hours.
> 
> Here's the memory stats for a typical process:
> 
> Memory Usage (in bytes):
> 
>   Size       :   97107968 (92.6M)
>   Share      :    6012928 ( 5.7M)
>   VSize      :   97107968 (92.6M)
>   RSS        :   85131264 (81.2M)
> 
> Memory Segments Usage (in bytes):
> 
> 
>   Text       :     253952 ( 248K)
>   Shlib      :          0 (   0K)
>   Data       :   78696448 (75.1M)
>   Stack      :          0 (   0K)
> 
> 
> 
> I have read practical mod_perl. I tried to preload many of our modules 
> in startup.pl. But the shared memory value doesnt change at all. Also, 
> doesnt 5.7M shared memory usage sound too small comparing to the 92.6M 
> total size?
> 
> I wonder how much is your shared memory? Is the memory overhead of 
> catalyst huge? Is catalyst inherently slow?
> 

I too have found that my Catalyst apps are "huge" compared to previous mod_perl 
or FastCGI apps.  I had been using Class::DBI and a hand-rolled framework, but 
now use Catalyst and DBIx::Class.  The difference is at least a factor of 2.

It's not been a problem for me at my current traffic levels, and I'm more than 
happy to trade some RAM for the joy the design and coding has become compared to 
my previous situation.

But I do wonder where all the RAM is going.  I especially concur that not much 
is being shared which is curious given that the modules are preloaded by 
mod_perl.  I had done some profiling to measure how much RAM a dummy Cat app 
took vs a dummy DBIC schema, maybe I'll dig that up and send it to the list.

Best,
Brian



More information about the Catalyst mailing list