[Catalyst] Re: memory usage of mod_perl process

Tony Losey tlosey at 3sixtygroup.com
Fri Feb 9 22:05:17 GMT 2007


On Fri February 9 2007 12:53 pm, Jeffrey Ng wrote:
> On 2/9/07, Oliver Gorwits <oliver.gorwits at oucs.ox.ac.uk> wrote:
> > 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.
> >
> > Take a good, hard look at what's coming out of your web servers. Install
> > a Squid farm in front of the servers and let them cache anything
> > suitable...
>
> yes we are thinking about that now. however, we are not sure how to update
> the cache we we want to refresh the page. i guess we will adjust the http
> header when we want to flush it? how does squid know if our page is
> refreshed when it has already cached our page though?...
>

You can call the PURGE command on squid. You must allow this in the conf and 
put in place the proper acl to allow it. I believe you can call squid with 
the following options to force a purge of the cache of a given page. 

-m PURGE http://mywebsite.com/index.html

We are not using catalyst in production yet so we don't have squid running in 
front of any catalyst apps. We do however have it running in front of some 
python/zope/plone sites. There are plugins that handle the purging directly 
for us. We just provide the url to purge to a method that handles the purge 
when needed.




> letting Apache fork just to serve an image can be really damaging to
>
> > performance. Double check the HTTP headers on all outgoing pages include
> > proper caching instructions for Squid so it'll work properly.
>
> yah, i know that. our catalyst apache servers are only for serving dynamic
> pages. however, there are some ajax javascript files we have to host on the
> exact same subdomain to work. i still feel that those javascript files are
> wasting our apache resources. for ajax javascript like that, how should i
> redirect the load to other servers while maintaining the same subdomain in
> the location bar? i tried to use mod_rewrite, and seems like its even
> slower than serving the file itself!
>
> Even whole store-front pages from Catalyst sites can usually be cached
>
> > well, because users don't have state at that point, and perhaps most
> > hits are to your homepage (so remember to let Squid know your homepage
> > is cacheable, in the headers).
> >
> > Remember mod_perl can be quite leaky as well, so kill off the child
> > processes after they've served a few requests. Oh, and switch off
> > hyperthreading if you have dual P4/Xeon boxes, and use PreFork MPM.
> >
> > There's more info in the slides from this LPW talk:
> >
> >
> > http://london.pm.org/lpw/talks/2006/dave_hodgkinson-mod_perl_server_farm_
> >architecture_done_right.pdf
> >
> > HTH,
> >
> > oliver.
> >
> >
> > _______________________________________________
> > List: Catalyst at 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/



More information about the Catalyst mailing list