Hi,<br><br>First of all thanks everyone for their responses.<br><br>On 1/18/07, <b class="gmail_sendername">Ezra Zygmuntowicz</b> <<a href="mailto:ezmobius@gmail.com">ezmobius@gmail.com</a>> 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> 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 'ps aefux' is below. Though I don'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 22988 0.7 11.3 142900 102572 ? S 21:53 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 22998 0.0 11.3 142900 102572 ? S 21:54 0:00 \_ /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 23000 0.0 11.3 142900 102572 ? S 21:54 0:00 \_ /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 22991 0.9 12.0 131192 108844 ? S 21:53 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 22996
0.0 12.0 131192 108844 ? S 21:54 0:00 \_ /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 22997 0.0 12.0 131192 108844 ? S 21:54 0:00 \_ /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 22994 0.5 10.1 127980 92160 ? S 21:53 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 22999 0.0 10.1 127980 92160 ? S 21:54 0:00 \_ /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 23001
0.0 10.1 127980 92160 ? S 21:54 0:00 \_ /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> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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;">
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. </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> </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>> How are the mongrel started (cron, launchd, etc)? I had something<br>> similar happen to me, but I think it was from the cluster being<br>> started by root instead of the user I wanted to start it. It gave me
<br>> an extra set of mongrel processes running that mongrel_rails<br>> cluster::stop wouldn't stop.<br>><br>> Michael B.<br>><br>> On 1/17/07, Surendra Singhi <<a href="mailto:singhi.surendra@gmail.com">
singhi.surendra@gmail.com</a>> wrote:<br>>> Hi,<br>>> I have mongrel 0.3.14, with ruby 1.8.5, rails 1.1.6 and mongrel<br>>> cluster<br>>> 0.2.1, on debian sage 3.1 with apache 2.0, and fastthread
0.6.1.<br>>> I am load balancing 3 mongrel processes using the random port trick.<br>>><br>>> When I start mongrel the processes have about 60MB, but after<br>>> some hour of<br>>> usage the memory ballons upto more than 180MB and the site becomes
<br>>> terribly<br>>> slow. Forcing me to restart mongrel cluster.<br>>><br>>> Also, it reports me 9 mongrel processes instead of three. I am not<br>>> able to<br>>> understand why that's happening. Are really 9 mongrel processes
<br>>> started<br>>> instead of three?<br>>><br>>> Please help. Thanks.<br>><br>> --<br>> Michael Biven<br>> <a href="mailto:michael.biven@gmail.com">michael.biven@gmail.com</a><br>>
<a href="http://biven.org">http://biven.org</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">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>