<br>This is what Mongrel invokes when that limit is hit:<br><br>&nbsp;&nbsp;&nbsp; def reap_dead_workers(reason=&#39;unknown&#39;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if @workers.list.length &gt; 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STDERR.puts &quot;#{Time.now}: Reaping #{@workers.list.length} threads for slow workers because of &#39;#{reason}&#39;&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error_msg = &quot;Mongrel timed out this thread: #{reason}&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mark = Time.now<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @workers.list.each do |worker|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; worker[:started_on] = Time.now if not worker[:started_on]<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if mark - worker[:started_on] &gt; @timeout + @throttle<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STDERR.puts &quot;Thread #{worker.inspect} is too old, killing.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; worker.raise(TimeoutError.new(error_msg))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br><br><br>So check your mongrel logs and see if mongrel is attempting (and possibly failing) to reap workers.<br>
<br><br>You could also slap this into application.rb:<br><br>&nbsp;&nbsp;&nbsp; def timeout
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Timeout.timeout(APPCONTROLLER_TIMEOUT) do
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; yield
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end
<br>&nbsp;&nbsp;&nbsp; end<br><br>Where APPCONTROLLER_TIMEOUT is the number of seconds you want any given controller action to run for.&nbsp; This will effecively force timeouts to occur independnt of host/os limits and mongrel&#39;s handling of exceptions thrown when reaching them.<br>
<br>I&#39;ve observed good results with that in some cases.<br><br><br>--&gt; But, see also: <a href="http://ph7spot.com/articles/system_timer">http://ph7spot.com/articles/system_timer</a> for more on timeouts and how effective (or ineffective) they can be.<br>
<br><br>Meanwhile, raising that open files limit might give you some time to bug-hunt with.&nbsp; Depends on how frequent the problem is being triggered.&nbsp;&nbsp; And have a look at HAProxy and/or NGINX if you&#39;re not already running them as a proxy tier / combo. in front of mongrel.&nbsp; <br>
<br>--<br><br><div class="gmail_quote">On Tue, Feb 10, 2009 at 12:06 PM, John Nestoriak <span dir="ltr">&lt;<a href="mailto:lists@ruby-forum.com">lists@ruby-forum.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Benjamin Grant wrote:<br>
&gt; Can you post the content of your mongrel_cluster.yml &nbsp;(or equivalent<br>
&gt; command<br>
&gt; line options in use) &amp; mongrel version...?<br>
&gt;<br>
&gt; Also the output of &quot;ulimit -a&quot; for the mongrel process owner.<br>
&gt;<br>
&gt; --<br>
<br>
</div>The mongrels are started under CPanel and we&#39;re not using clusters.<br>
<br>
&gt;From ps it looks like they&#39;re just started with:<br>
/usr/bin/ruby /usr/bin/mongrel_rails start -p 12005 -d -e production -P<br>
log/mongrel.pid<br>
<br>
It&#39;s running mongrel 1.1.5<br>
ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux]<br>
<br>
I&#39;m not sure exactly how many file descriptors causes it to die - though<br>
I&#39;ve seen 400+ and it running fine and I&#39;m guessing it dies at 512.<br>
<br>
Ulimit doesn&#39;t seem like it&#39;s changed at all.<br>
<br>
core file size &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(blocks, -c) 0<br>
data seg size &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (kbytes, -d) unlimited<br>
file size &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (blocks, -f) unlimited<br>
pending signals &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (-i) 1024<br>
max locked memory &nbsp; &nbsp; &nbsp; (kbytes, -l) 32<br>
max memory size &nbsp; &nbsp; &nbsp; &nbsp; (kbytes, -m) unlimited<br>
open files &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(-n) 1024<br>
pipe size &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(512 bytes, -p) 8<br>
POSIX message queues &nbsp; &nbsp; (bytes, -q) 819200<br>
stack size &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(kbytes, -s) 10240<br>
cpu time &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (seconds, -t) unlimited<br>
max user processes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(-u) 73728<br>
virtual memory &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(kbytes, -v) unlimited<br>
file locks &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(-x) unlimited<br>
<font color="#888888">--<br>
</font><div><div></div><div class="Wj3C7c">Posted via <a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>.<br>
_______________________________________________<br>
Mongrel-users mailing list<br>
<a href="mailto:Mongrel-users@rubyforge.org">Mongrel-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/mongrel-users" target="_blank">http://rubyforge.org/mailman/listinfo/mongrel-users</a><br>
</div></div></blockquote></div><br>