<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.gmailquote
        {mso-style-name:gmail_quote;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thanks very much for the pointer &#8211; it&#8217;s good to know that I&#8217;m
not alone in my troubles. I&#8217;m now actually planning on writing a ProcManager
based on FCGI::Engine::ProcManager that incorporates some true process
management &#8211; a la MaxRequestsPerChild &#8211; rather than just a loop to startup X
childs and then a blocking wait().<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>v/r<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>-matt pitts<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Matthieu Codron
[mailto:matthieu@codron.org] <br>
<b>Sent:</b> Monday, March 31, 2008 5:22 AM<br>
<b>To:</b> The elegant MVC web framework<br>
<b>Subject:</b> Re: [Catalyst] Memory leak under FastCGI?<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>There was something about growing FastCGI processes in the
Catalyst advent calendar: <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><a href="http://www.catalystframework.org/calendar/2007/18">http://www.catalystframework.org/calendar/2007/18</a><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>In short: Apparently this is normal behavior, and the
article recommends you, like&nbsp;you suggested,&nbsp;to periodically restart
fastcgi processes to keep memory usage reasonable.<br>
&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span class=gmailquote>On 3/19/08, <b>Matt Pitts</b> &lt;<a
href="mailto:mpitts@a3its.com">mpitts@a3its.com</a>&gt; wrote:</span> <o:p></o:p></p>

<p class=MsoNormal>We have a Catalyst app that I recently (about a month ago)
converted<br>
from running under mod_fcgid to external under mod_fastcgi and it<br>
appears to be leaking memory. There are 2 application backends and they<br>
both suffered oom-killer events within six minutes of one another<br>
yesterday and one of them again this morning after a cron job ran that<br>
experienced some deep recursion calls.<br>
<br>
Both backends were running out of PARs when the first OOM events<br>
occurred. To eliminate the PAR setup itself as a cause, I started one of<br>
the backends by directly invoking myapp_fastcgi.pla and its memory<br>
behavior is the same, so I'm pretty confident the invocation via PAR is<br>
not a cause.<br>
<br>
I also checked my versions of CGI::FormBuilder to ensure I was up to<br>
3.501 and these all checked out.<br>
<br>
I have not yet determined if the conversion from mod_fcgid to<br>
mod_fastcgi external is when the RAM usage started climbing - still<br>
awaiting system reports - but, there haven't been an substantial changes<br>
to the app since then that I would consider potential causes of a memory<br>
leak. I'm guessing it's been there for a while, but it's only now<br>
evident because the app instances were getting automatically recycled by<br>
mod_fcgid and now they're not.<br>
<br>
I'm hoping someone here might have some light to shine on common FastCGI<br>
memory leak issues.<br>
<br>
Is it generally an acceptable practice to just restart the external<br>
fastcgi process periodically to free its memory?<br>
<br>
Any input is greatly appreciated.<br>
<br>
v/r<br>
-matt pitts<br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a
href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/">http://dev.catalyst.perl.org/</a><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</body>

</html>