Hi,<br><br>First of all thanks everyone for their responses.<br><br>On 1/18/07, <b class="gmail_sendername">Ezra Zygmuntowicz</b> &lt;<a href="mailto:ezmobius@gmail.com">ezmobius@gmail.com</a>&gt; wrote:<div><span class="gmail_quote">
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Some linux distros have weird reporting of processes. I have seen it<br>where top or ps will report 3 mongrels for each one that is really
<br>running. And looking at your output you can see that each set of<br>three mongrels reported have the same port number. This means that<br>you really only have 3 mongrels running because only one can be<br>running per port at a time.
</blockquote><div><br>The output of &#39;ps aefux&#39; is below. Though I don&#39;t understand ps completely it seems that the one mongrel process spawns another child process, which in turns spawns a third one.<br><br><br>
ssinghi&nbsp; 22988&nbsp; 0.7 11.3 142900 102572 ?&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21:53&nbsp;&nbsp; 0:24 /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8000 -a <a href="http://127.0.0.1">127.0.0.1</a> -P log/mon<br>ssinghi&nbsp; 22998&nbsp; 0.0 11.3 142900 102572 ?&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21:54&nbsp;&nbsp; 0:00&nbsp; \_ /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8000 -a 
<a href="http://127.0.0.1">127.0.0.1</a> -P log<br>ssinghi&nbsp; 23000&nbsp; 0.0 11.3 142900 102572 ?&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21:54&nbsp;&nbsp; 0:00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_ /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8000 -a <a href="http://127.0.0.1">
127.0.0.1</a> -P<br>ssinghi&nbsp; 22991&nbsp; 0.9 12.0 131192 108844 ?&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21:53&nbsp;&nbsp; 0:33 /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8001 -a <a href="http://127.0.0.1">127.0.0.1</a> -P log/mon<br>ssinghi&nbsp; 22996&nbsp; 
0.0 12.0 131192 108844 ?&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21:54&nbsp;&nbsp; 0:00&nbsp; \_ /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8001 -a <a href="http://127.0.0.1">127.0.0.1</a> -P log<br>ssinghi&nbsp; 22997&nbsp; 0.0 12.0 131192 108844 ?&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21:54&nbsp;&nbsp; 0:00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_ /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8001 -a 
<a href="http://127.0.0.1">127.0.0.1</a> -P<br>ssinghi&nbsp; 22994&nbsp; 0.5 10.1 127980 92160 ?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21:53&nbsp;&nbsp; 0:18 /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8002 -a <a href="http://127.0.0.1">127.0.0.1</a>
 -P log/mon<br>ssinghi&nbsp; 22999&nbsp; 0.0 10.1 127980 92160 ?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21:54&nbsp;&nbsp; 0:00&nbsp; \_ /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8002 -a <a href="http://127.0.0.1">127.0.0.1</a> -P log<br>ssinghi&nbsp; 23001&nbsp; 
0.0 10.1 127980 92160 ?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp; 21:54&nbsp;&nbsp; 0:00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_ /usr/bin/ruby1.8 /usr/bin/mongrel_rails start -d -e production -p 8002 -a <a href="http://127.0.0.1">127.0.0.1</a> -P<br><br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;As far as the memory usage goes, that sounds like a classic memory<br>leak in your rails app. I have seen mongrel balloon like that when<br>people add an extra :include directive to a find that ends up loading<br>
a ton of extra records into memory. If you are loading more then a<br>few hundred ActiveRecords into memory on any one page then that will<br>surely cause memory to ballon like this.</blockquote><div><br>Yes, we are doing eager loading at many places, and there is a sitemap part
<br>where about 10,000 records are loaded. I will try to optimize those parts, and see <br>if they make a difference. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A little more info about your app and what it does woudl help debug.<br>Are you using Rmagcik? </blockquote><div><br>Yes we are using that. I will look into mini-magick. Joey thanks for that.&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Are you useing send_file or send_data to<br>stream out large content?</blockquote><div><br>We are streaming data for images. <br><br>We are also using ferret and mediacloth.<br><br>I guess, I need to investigate more on the above mentioned things.
<br>Thanks a lot.<br></div><br>Surendra Singhi<br><div><br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Jan 17, 2007, at 10:36 AM, Michael Biven wrote:
<br><br>&gt; How are the mongrel started (cron, launchd, etc)? I had something<br>&gt; similar happen to me, but I think it was from the cluster being<br>&gt; started by root instead of the user I wanted to start it. It gave me
<br>&gt; an extra set of mongrel processes running that mongrel_rails<br>&gt; cluster::stop wouldn&#39;t stop.<br>&gt;<br>&gt; Michael B.<br>&gt;<br>&gt; On 1/17/07, Surendra Singhi &lt;<a href="mailto:singhi.surendra@gmail.com">
singhi.surendra@gmail.com</a>&gt; wrote:<br>&gt;&gt; Hi,<br>&gt;&gt;&nbsp;&nbsp; I have mongrel 0.3.14, with ruby 1.8.5, rails 1.1.6 and mongrel<br>&gt;&gt; cluster<br>&gt;&gt; 0.2.1, on debian sage 3.1 with apache 2.0, and fastthread 
0.6.1.<br>&gt;&gt; I am load balancing 3 mongrel processes using the random port trick.<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;When I start mongrel the processes have about 60MB, but after<br>&gt;&gt; some hour of<br>&gt;&gt; usage the memory ballons upto more than 180MB and the site becomes
<br>&gt;&gt; terribly<br>&gt;&gt; slow. Forcing me to restart mongrel cluster.<br>&gt;&gt;<br>&gt;&gt; Also, it reports me 9 mongrel processes instead of three. I am not<br>&gt;&gt; able to<br>&gt;&gt; understand why that&#39;s happening. Are really 9 mongrel processes
<br>&gt;&gt; started<br>&gt;&gt; instead of three?<br>&gt;&gt;<br>&gt;&gt; Please help. Thanks.<br>&gt;<br>&gt; --<br>&gt; Michael Biven<br>&gt; <a href="mailto:michael.biven@gmail.com">michael.biven@gmail.com</a><br>&gt; 
<a href="http://biven.org">http://biven.org</a><br>&gt; _______________________________________________<br>&gt; Mongrel-users mailing list<br>&gt; <a href="mailto:Mongrel-users@rubyforge.org">Mongrel-users@rubyforge.org</a>
<br>&gt; <a href="http://rubyforge.org/mailman/listinfo/mongrel-users">http://rubyforge.org/mailman/listinfo/mongrel-users</a><br><br>-- Ezra Zygmuntowicz<br>-- Lead Rails Evangelist<br>-- <a href="mailto:ez@engineyard.com">
ez@engineyard.com</a><br>-- Engine Yard, Serious Rails Hosting<br>-- (866) 518-YARD (9273)<br><br><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">http://rubyforge.org/mailman/listinfo/mongrel-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Surendra Singhi
<br><a href="http://ssinghi.kreeti.com">http://ssinghi.kreeti.com</a>, <a href="http://www.kreeti.com">http://www.kreeti.com</a>