<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Thats
interesting. A diff would be useful if you have one.<br>
<br>
What's the best way to set these settings? At the moment I'm exporting
them just before I use spawn-fcgi (from lighttpd), but even though I've
set it to a low number (10) I don't think its being honoured. I'm
running CentOS5, if that's any help.<br>
<br>
If I can't find a suitable work-around for this I may have to switch to
apache with php compiled in - something I don't really want to do as
I'm finding working with nginx to be a great experience.<br>
</font></font><br>
Reinis Rozitis wrote:
<blockquote cite="mid:006801c88e6b$9e4b29b0$0201a8c0@wired" type="cite">Thats
a common issue (at least for me). Although php leaks itself with every
version less there are still quite a bunch of extensions outside that
dont handle the memory bits the right way.
  <br>
  <br>
As a workarround I use this patch
<a class="moz-txt-link-freetext" href="http://devzone.zend.com/content/patch/pat38.txt">http://devzone.zend.com/content/patch/pat38.txt</a>
  <br>
  <br>
Its pretty old and made for php4 but with little tweaks you can apply
also to php5 (I could make a diff and throw in here). The basic idea is
you have an extra setting PHP_FCGI_MAX_RAM_MB - you can limit at what
memory usage the php child should handle the last request and die (so
the master process can spawn a new one - similar to
PHP_FCGI_MAX_REQUESTS ).
  <br>
  <br>
This solution is better because you dont accidently kill a process
which is in a middle of generating a response.
  <br>
  <br>
rr
  <br>
  <br>
----- Original Message ----- From: "Phillip B Oldham"
<a class="moz-txt-link-rfc2396E" href="mailto:phill@theactivitypeople.co.uk">&lt;phill@theactivitypeople.co.uk&gt;</a>
  <br>
To: <a class="moz-txt-link-rfc2396E" href="mailto:nginx@sysoev.ru">&lt;nginx@sysoev.ru&gt;</a>
  <br>
Sent: Tuesday, March 25, 2008 11:44 AM
  <br>
Subject: php-fastcgi and memory leaks
  <br>
  <br>
  <br>
  <blockquote type="cite">Further to the email below, I'm still having
problems with PHP5 fastcgi
    <br>
and nginx. I'm finding that php slowly takes up 100% of the available
    <br>
memory and starts to drop connections at around 70%. At the moment I've
    <br>
got monit restarting the fastcgi processes when the memory usage hits
    <br>
70%, but this isn't optimal as the scripts I'm running shouldn't take
    <br>
anywhere near that on a virtual server with 300MB dedicated ram.
    <br>
    <br>
I'm wondering whether anyone else has come across the same problem
    <br>
running php5 fastcgi who has managed to find a fix or work-around?
    <br>
  </blockquote>
  <br>
  <br>
  <br>
  <br>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<div
 style="font-family: sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 1.1; font-size-adjust: none; font-stretch: normal; width: 300px; color: rgb(51, 51, 51);">
<p><strong>Phillip B Oldham</strong><br>
The Activity People<br>
<a href="mailto:phill@theactivitypeople.co.uk">phill@theactivitypeople.co.uk</a></p>
<hr size="1">
<p style="font-size: 90%;"><strong>Policies</strong></p>
<p style="font-size: 90%;">This e-mail and its attachments are intended
for the above named recipient(s) only and may be confidential. If they
have come to you in error, please reply to this e-mail and highlight
the error. No action should be taken regarding content, nor must you
copy or show them to anyone.</p>
<p style="font-size: 90%;">This e-mail has been created in the
knowledge that Internet e-mail is not a 100% secure communications
medium, and we have taken steps to ensure that this e-mail and
attachments are free from any virus. We must advise that in keeping
with good computing practice the recipient should ensure they are
completely virus free, and that you understand and observe the lack of
security when e-mailing us.</p>
<hr size="1">
</div>
</div>
</body>
</html>