<br>This is what Mongrel invokes when that limit is hit:<br><br> def reap_dead_workers(reason='unknown')<br> if @workers.list.length > 0<br> STDERR.puts "#{Time.now}: Reaping #{@workers.list.length} threads for slow workers because of '#{reason}'"<br>
error_msg = "Mongrel timed out this thread: #{reason}"<br> mark = Time.now<br> @workers.list.each do |worker|<br> worker[:started_on] = Time.now if not worker[:started_on]<br><br> if mark - worker[:started_on] > @timeout + @throttle<br>
STDERR.puts "Thread #{worker.inspect} is too old, killing."<br> worker.raise(TimeoutError.new(error_msg))<br> end<br> end<br> 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> def timeout
<br> Timeout.timeout(APPCONTROLLER_TIMEOUT) do
<br> yield
<br> end
<br> end<br><br>Where APPCONTROLLER_TIMEOUT is the number of seconds you want any given controller action to run for. This will effecively force timeouts to occur independnt of host/os limits and mongrel's handling of exceptions thrown when reaching them.<br>
<br>I've observed good results with that in some cases.<br><br><br>--> 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. Depends on how frequent the problem is being triggered. And have a look at HAProxy and/or NGINX if you're not already running them as a proxy tier / combo. in front of mongrel. <br>
<br>--<br><br><div class="gmail_quote">On Tue, Feb 10, 2009 at 12:06 PM, John Nestoriak <span dir="ltr"><<a href="mailto:lists@ruby-forum.com">lists@ruby-forum.com</a>></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>
> Can you post the content of your mongrel_cluster.yml (or equivalent<br>
> command<br>
> line options in use) & mongrel version...?<br>
><br>
> Also the output of "ulimit -a" for the mongrel process owner.<br>
><br>
> --<br>
<br>
</div>The mongrels are started under CPanel and we're not using clusters.<br>
<br>
>From ps it looks like they'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's running mongrel 1.1.5<br>
ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux]<br>
<br>
I'm not sure exactly how many file descriptors causes it to die - though<br>
I've seen 400+ and it running fine and I'm guessing it dies at 512.<br>
<br>
Ulimit doesn't seem like it's changed at all.<br>
<br>
core file size (blocks, -c) 0<br>
data seg size (kbytes, -d) unlimited<br>
file size (blocks, -f) unlimited<br>
pending signals (-i) 1024<br>
max locked memory (kbytes, -l) 32<br>
max memory size (kbytes, -m) unlimited<br>
open files (-n) 1024<br>
pipe size (512 bytes, -p) 8<br>
POSIX message queues (bytes, -q) 819200<br>
stack size (kbytes, -s) 10240<br>
cpu time (seconds, -t) unlimited<br>
max user processes (-u) 73728<br>
virtual memory (kbytes, -v) unlimited<br>
file locks (-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>