[Catalyst] Memory leak under FastCGI?

Matt Pitts mpitts at a3its.com
Mon Mar 31 17:04:45 BST 2008


Thanks very much for the pointer - it's good to know that I'm not alone
in my troubles. I'm now actually planning on writing a ProcManager based
on FCGI::Engine::ProcManager that incorporates some true process
management - a la MaxRequestsPerChild - rather than just a loop to
startup X childs and then a blocking wait().

 

v/r

 

-matt pitts

 

From: Matthieu Codron [mailto:matthieu at codron.org] 
Sent: Monday, March 31, 2008 5:22 AM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Memory leak under FastCGI?

 

There was something about growing FastCGI processes in the Catalyst
advent calendar: 

 

http://www.catalystframework.org/calendar/2007/18

 

In short: Apparently this is normal behavior, and the article recommends
you, like you suggested, to periodically restart fastcgi processes to
keep memory usage reasonable.
 

On 3/19/08, Matt Pitts <mpitts at a3its.com> wrote: 

We have a Catalyst app that I recently (about a month ago) converted
from running under mod_fcgid to external under mod_fastcgi and it
appears to be leaking memory. There are 2 application backends and they
both suffered oom-killer events within six minutes of one another
yesterday and one of them again this morning after a cron job ran that
experienced some deep recursion calls.

Both backends were running out of PARs when the first OOM events
occurred. To eliminate the PAR setup itself as a cause, I started one of
the backends by directly invoking myapp_fastcgi.pla and its memory
behavior is the same, so I'm pretty confident the invocation via PAR is
not a cause.

I also checked my versions of CGI::FormBuilder to ensure I was up to
3.501 and these all checked out.

I have not yet determined if the conversion from mod_fcgid to
mod_fastcgi external is when the RAM usage started climbing - still
awaiting system reports - but, there haven't been an substantial changes
to the app since then that I would consider potential causes of a memory
leak. I'm guessing it's been there for a while, but it's only now
evident because the app instances were getting automatically recycled by
mod_fcgid and now they're not.

I'm hoping someone here might have some light to shine on common FastCGI
memory leak issues.

Is it generally an acceptable practice to just restart the external
fastcgi process periodically to free its memory?

Any input is greatly appreciated.

v/r
-matt pitts

_______________________________________________
List: Catalyst at lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080331/0b34f000/attachment.htm


More information about the Catalyst mailing list