I do not know how you restart nginx but you can send the control process &quot;kill -HUP&quot; and it will do exactly what you want, which is gracefully restart each worker process. You can have a script check for the memory usage and do that when you see it is getting high, or simply do that every 24 hours.<br>
<br>Kiril<br><br><br><div class="gmail_quote">On Thu, Feb 21, 2008 at 2:17 PM, Todd HG &lt;<a href="mailto:lists@ruby-forum.com">lists@ruby-forum.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt;&gt; Igor Sysoev wrote:<br>
&gt;&gt; &gt; On Wed, Feb 20, 2008 at 11:47:29PM +0100,<br>
&gt;&gt;<br>
&gt;&gt; Is there anywhere I could read more about how Nginx uses<br>
&gt;&gt; connection_pool_size, stores connections, if it is in a cache in RAM or<br>
&gt;&gt; hard drive, and what else might be stored in RAM by Nginx?<br>
&gt;<br>
&gt; All that you need is to disable gzipping images. It&#39;s enough.<br>
&gt; Other default settings do not allow workers to grow up.<br>
<br>
Of course disabling gzip defeats the purpose of having gzip decrease<br>
bandwidth and increase site speed for readers. Right now I only have<br>
gzip handling a few million js and css files a day, in addition to tens<br>
of millions of images which are not gzipped, but the RAM usage just<br>
grows until it is completely consumed. By setting the gzip compression<br>
level to 1 the RAM consumption grows more slowly, but eventually eats<br>
all the RAM.<br>
<br>
It appears what might be needed is a setting to allow the total number<br>
of connections for gzip to be set before Nginx automatically kills and<br>
restarts a worker. This would be similar to the Apache<br>
MaxRequestsPerChild limit setting. There should be a way to set Nginx to<br>
kill and restart the worker process to free the RAM, and start again at<br>
zero for situations like mine.<br>
<br>
Without a solution I need to restart my server about every 24 hours, and<br>
this is a very robust server.<br>
<font color="#888888"><br>
--<br>
Posted via <a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>.<br>
<br>
</font></blockquote></div><br>