From evan at cloudbur.st Thu Nov 1 03:36:21 2007 From: evan at cloudbur.st (Evan Weaver) Date: Thu, 1 Nov 2007 03:36:21 -0400 Subject: [Mongrel] Mongrel 1.1 Message-ID: Hello Mongrels, Mongrel 1.1 is out with fullblown JRuby support, some reorganization, and some bugfixes. Also, Mongrel_cluster has been updated to 1.0.4. Go subscribe to the all-new news feed, because we probably won't announce to the list anymore: http://mongrel.rubyforge.org/rss.xml Thanks Evan, and the Mongrel Team -- Evan Weaver Cloudburst, LLC From lists at ruby-forum.com Thu Nov 1 05:58:39 2007 From: lists at ruby-forum.com (Matt Su) Date: Thu, 1 Nov 2007 10:58:39 +0100 Subject: [Mongrel] Mongrel + apache 2.2 + proxy error Message-ID: <5729527e61082c10eb8e04e3615c2565@ruby-forum.com> Hi, I have a setup with apache 2.2.6 proxying requests to a cluster of 5 mongrels. Occassionally, I receive the following error in the logs: [Tue Oct 30 12:00:28 2007] [error] (70007)The timeout specified has expired: proxy: pass request body failed to 127.0.0.1:8013 (127.0.0.1) from 213.205.247.171 () [Tue Oct 30 12:00:28 2007] [error] [client 213.205.247.171] Handler for proxy-server returned invalid result code 70007 It may be worth noting that the Mongrels are dealing with potentially long running HTTP POSTs: they come from Mobile Clients uploading around 2 -3 MB of data, which can take several minutes. It is my understanding that a Mongrel will not be tied up whilst the upload is being done as Mongrel will create a thread to handle the upload, stream it to a TempFile, and then lock rails. The rails action that deals with the file typically takes 1/2 second to 1 second. Looking at the error message, it looks like Mongrel may be ignoring the request or Apache is Timing Out whilst forwarding the request to Mongrel. Can anyone help in decrypting what this error message may mean? Thanks in advance! -- Posted via http://www.ruby-forum.com/. From dave at cheney.net Thu Nov 1 06:07:25 2007 From: dave at cheney.net (Dave Cheney) Date: Thu, 1 Nov 2007 21:07:25 +1100 Subject: [Mongrel] Mongrel + apache 2.2 + proxy error In-Reply-To: <5729527e61082c10eb8e04e3615c2565@ruby-forum.com> References: <5729527e61082c10eb8e04e3615c2565@ruby-forum.com> Message-ID: Hi Matt, I believe that this error is reported when the client stops sending data. If you grep through the sources the area that generates this error is still related to the request. For us, this was a clue that eventually pointed to a duplex mismatch upstream from our rack that was causing tcp connections to collapse under heavy traffic. Cheers Dave On 01/11/2007, at 8:58 PM, Matt Su wrote: > I have a setup with apache 2.2.6 proxying requests to a cluster of 5 > mongrels. Occassionally, I receive the following error in the logs: > > [Tue Oct 30 12:00:28 2007] [error] (70007)The timeout specified has > expired: proxy: pass request body failed to 127.0.0.1:8013 (127.0.0.1) > from 213.205.247.171 () > [Tue Oct 30 12:00:28 2007] [error] [client 213.205.247.171] Handler > for > proxy-server returned invalid result code 70007 From lists at ruby-forum.com Thu Nov 1 06:37:07 2007 From: lists at ruby-forum.com (Matt Su) Date: Thu, 1 Nov 2007 11:37:07 +0100 Subject: [Mongrel] Mongrel + apache 2.2 + proxy error In-Reply-To: References: <5729527e61082c10eb8e04e3615c2565@ruby-forum.com> Message-ID: Hi Dave thanks for replying Does this mean that when a request comes in, Apache doesn't hand off the request to Mongrel until it has received the entirety of the request? If not, how does Apache know the connection has been closed/client has stopped sending data. I thought it worked (roughly) like: 1 Apache receives beginning of request (Content-length headers and so on) 2 Apache forwards request to Mongrel 3 Mongrel begins reading request (in my case uploading a 3 MB file over a slow connection) In the above scenario, if the client stopped sending data, would it not be Mongrel that raised the error? Thanks very much! Dave Cheney wrote: > Hi Matt, > > I believe that this error is reported when the client stops sending > data. If you grep through the sources the area that generates this > error is still related to the request. For us, this was a clue that > eventually pointed to a duplex mismatch upstream from our rack that > was causing tcp connections to collapse under heavy traffic. > > Cheers > > Dave -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 1 07:53:56 2007 From: lists at ruby-forum.com (Luca Reghellin) Date: Thu, 1 Nov 2007 12:53:56 +0100 Subject: [Mongrel] problems with 'localization simplified' In-Reply-To: References: <0a3360c51f5a17cb6df1c71c550fff73@ruby-forum.com> Message-ID: In fact no. I've started again my application and I have the same errors (see below). This is not an help request. Simply to tell that localization simplified gives too problems, and I'll not use it anymore. I'm going the heavy way, globalize... can't convert nil into String /Users/stratboy/Documents/05_SAMPLES/RAILS/newser/vendor/plugins/l10n-simplified-0.8/lib/localization_simplified.rb:13:in `gsub!' /Users/stratboy/Documents/05_SAMPLES/RAILS/newser/vendor/plugins/l10n-simplified-0.8/lib/localization_simplified.rb:13:in `localize_strftime' /Users/stratboy/Documents/05_SAMPLES/RAILS/newser/vendor/plugins/l10n-simplified-0.8/lib/localization_simplified.rb:191:in `strftime' /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/core_ext/time/conversions.rb:19:in `to_s' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/cgi_ext/session_performance_fix.rb:21:in `create_new_id' /opt/local/lib/ruby/1.8/cgi/session.rb:267:in `initialize' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/cgi_process.rb:132:in `new' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/cgi_process.rb:132:in `session' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/cgi_process.rb:164:in `stale_session_check!' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/cgi_process.rb:116:in `session' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:1058:in `assign_shortcuts_without_flash' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/flash.rb:140:in `assign_shortcuts' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:429:in `process_without_filters' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/filters.rb:684:in `process_without_session_management_support' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/session_management.rb:114:in `process' /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:334:in `process' /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/dispatcher.rb:41:in `dispatch' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in `process' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in `synchronize' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in `process' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in `process_client' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in `each' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in `process_client' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `initialize' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `new' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in `initialize' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in `new' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in `each' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in `load' /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in `load' /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in' /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in `load' /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/servers/mongrel.rb:60 /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require' /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in' /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require' /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/server.rb:39 /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3 -- Posted via http://www.ruby-forum.com/. From david at vrensk.com Thu Nov 1 10:43:17 2007 From: david at vrensk.com (David Vrensk) Date: Thu, 1 Nov 2007 15:43:17 +0100 Subject: [Mongrel] Is it possible to ? In-Reply-To: References: Message-ID: <81b453920711010743p732b923fgb39c4f9d43ebed6a@mail.gmail.com> On 10/31/07, Squeak Smalltalk wrote: > > Hi, > > Can I use mongrel for ? Preprocessing an url ? > > What I need todo is : > 1- When a user connect to an Specific url. > 2- Connect to a site an other site with login > 3- And redirect this user to the site on step 2 Mongrel is an application container, so you are looking at the wrong level. Yes, you can do what you are asking with a handler that you register in Mongrel, or with a Rails/Merb/whatever application that Mongrel runs. To find out how to do what you want, look in web developer forums. Good luck! /David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071101/963f7b7a/attachment.html From kevwil at gmail.com Thu Nov 1 10:51:12 2007 From: kevwil at gmail.com (Kevin Williams) Date: Thu, 1 Nov 2007 08:51:12 -0600 Subject: [Mongrel] Mongrel 1.1 In-Reply-To: References: Message-ID: <683a886f0711010751l60653e3bvb73f4abe0e3a2713@mail.gmail.com> Ah, that explains why I didn't know about 1.0.2 or 1.0.3 until 1.0.4 came out. Thanks for the clarification. :) On 11/1/07, Evan Weaver wrote: > Hello Mongrels, > > Mongrel 1.1 is out with fullblown JRuby support, some reorganization, > and some bugfixes. Also, Mongrel_cluster has been updated to 1.0.4. > > Go subscribe to the all-new news feed, because we probably won't > announce to the list anymore: > > http://mongrel.rubyforge.org/rss.xml > > Thanks > > Evan, and the Mongrel Team > > -- > Evan Weaver > Cloudburst, LLC > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Cheers, Kevin Williams http://kevwil.com/ http://www.almostserio.us/ http://kevwil.jaiku.com/ From will at hotgazpacho.com Thu Nov 1 11:06:16 2007 From: will at hotgazpacho.com (will at hotgazpacho.com) Date: Thu, 01 Nov 2007 11:06:16 -0400 Subject: [Mongrel] Mongrel 1.1 In-Reply-To: <683a886f0711010751l60653e3bvb73f4abe0e3a2713@mail.gmail.com> References: <683a886f0711010751l60653e3bvb73f4abe0e3a2713@mail.gmail.com> Message-ID: <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> I'm curious to know why the URL classifier was moved from C code to Ruby code. I am under the impression that Ruby code is often much slower than C extensions. I'm also under the impression that the URL classifier is somewhere that speed would be desirable. Please tell me if my impressions are based on false premises... == Will Green From _ at whats-your.name Thu Nov 1 11:09:45 2007 From: _ at whats-your.name (cdr) Date: Thu, 1 Nov 2007 11:09:45 -0400 Subject: [Mongrel] Mongrel 1.1 In-Reply-To: <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> References: <683a886f0711010751l60653e3bvb73f4abe0e3a2713@mail.gmail.com> <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> Message-ID: <20071101150944.GA1638@replic.net> On Thu Nov 01, 2007 at 11:06:16AM -0400, will at hotgazpacho.com wrote: > I'm curious to know why the URL classifier was moved from C code to > Ruby code. really? my database dependson the performance of the C version of the URL classifier perhaps you told rubygems to install a pure ruby version instead of a ruby+C version? er no, the 'ruby' in rubygems usually means posix (and ruby+C) while 'win32' means what it says From wyhaines at gmail.com Thu Nov 1 11:38:53 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 1 Nov 2007 08:38:53 -0700 Subject: [Mongrel] Mongrel 1.1 In-Reply-To: <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> References: <683a886f0711010751l60653e3bvb73f4abe0e3a2713@mail.gmail.com> <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> Message-ID: On 11/1/07, will at hotgazpacho.com wrote: > I'm curious to know why the URL classifier was moved from C code to > Ruby code. I am under the impression that Ruby code is often much > slower than C extensions. I'm also under the impression that the URL > classifier is somewhere that speed would be desirable. > > Please tell me if my impressions are based on false premises... > > == > Will Green > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From wyhaines at gmail.com Thu Nov 1 11:43:02 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 1 Nov 2007 08:43:02 -0700 Subject: [Mongrel] Mongrel 1.1 In-Reply-To: <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> References: <683a886f0711010751l60653e3bvb73f4abe0e3a2713@mail.gmail.com> <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> Message-ID: On 11/1/07, will at hotgazpacho.com wrote: > I'm curious to know why the URL classifier was moved from C code to > Ruby code. I am under the impression that Ruby code is often much > slower than C extensions. I'm also under the impression that the URL > classifier is somewhere that speed would be desirable. C code will generally be faster than Ruby code, yes. The thing with the classifier is that for small numbers of urls to classify, the pure ruby solution is as fast or faster than the trie based C classifier, and the decision was made that the simplification represented by switching to a pure ruby solution there was a beneficial tradeoff, since most people do not have more than a dozen handlers registered with a mongrel instance, so for most people there will be no performance loss. Kirk Haines From baldmountain at gmail.com Thu Nov 1 11:58:37 2007 From: baldmountain at gmail.com (Geoffrey Clements) Date: Thu, 1 Nov 2007 11:58:37 -0400 Subject: [Mongrel] Mongrel 1.1 In-Reply-To: References: <683a886f0711010751l60653e3bvb73f4abe0e3a2713@mail.gmail.com> <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> Message-ID: <472ed2750711010858m4808fec8g92f68b18687232de@mail.gmail.com> You still have to keep in mind that there is overhead to calling native code. For small methods that don't do much it is often better to write the code in the script language rather than suffer the overhead of a native method call. Rather than judging the ruby version bad, upgrade and profile to see if there is a performance issue. On 11/1/07, Kirk Haines wrote: > > > C code will generally be faster than Ruby code, yes. > > > -- geoff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071101/fe300c51/attachment.html From will at hotgazpacho.com Thu Nov 1 13:11:46 2007 From: will at hotgazpacho.com (will at hotgazpacho.com) Date: Thu, 01 Nov 2007 13:11:46 -0400 Subject: [Mongrel] Mongrel 1.1 In-Reply-To: References: <683a886f0711010751l60653e3bvb73f4abe0e3a2713@mail.gmail.com> <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> Message-ID: <20071101131146.a49zlm9ib7z4g4o0@webmail.hotgazpacho.com> Ah, well that makes sense! Thanks for clearing that up! Quoting Kirk Haines : > On 11/1/07, will at hotgazpacho.com wrote: >> I'm curious to know why the URL classifier was moved from C code to >> Ruby code. I am under the impression that Ruby code is often much >> slower than C extensions. I'm also under the impression that the URL >> classifier is somewhere that speed would be desirable. > > C code will generally be faster than Ruby code, yes. > > The thing with the classifier is that for small numbers of urls to > classify, the pure ruby solution is as fast or faster than the trie > based C classifier, and the decision was made that the simplification > represented by switching to a pure ruby solution there was a > beneficial tradeoff, since most people do not have more than a dozen > handlers registered with a mongrel instance, so for most people there > will be no performance loss. > > > Kirk Haines > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From wyhaines at gmail.com Thu Nov 1 16:16:18 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 1 Nov 2007 13:16:18 -0700 Subject: [Mongrel] Automatic Scaling In-Reply-To: References: <0B24FE11-B64C-4328-80DC-9E4885D8CF2C@ibexinternet.co.uk> Message-ID: On 10/23/07, Jeremy Wilkins wrote: > > How fast is your app? How many mongrels do you figure you need to > > handle that volume? > > Hopefully very fast - I'm aiming to get it down to 1 or 2 database > queries per (ajax) request, with just a small amount to text being > sent back. We're currently planning this part of the so don't have > any stats yet. My concern is that it will probably be being hosted on > our existing (heavily loaded) PHP server till the clients needs > enough instances to justify their own server. It's hard to guage when you are sharing machine cycles with a heavily loaded PHP app, but, depending on what those queries really do, 20 r/s should be trivial to get with modest hardware and a tiny number of mongrels (just a single mongrel is likely practical for a load that low). > Sounds very interesting - I'm pretty new to all this but this seems > to be one area where FastCGI (and I presume SCGI) has significant > advantage over the mongrel cluster approach. How long do you > anticipate it will take to develop your solution (just curious - I > know its a when its done thing). It's part of the Swiftiply 0.7.0 feature set. I'm already late on when I wanted to release it, but realistically, it's probably another month or so away. Kirk Haines From evan at cloudbur.st Fri Nov 2 01:47:18 2007 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 2 Nov 2007 01:47:18 -0400 Subject: [Mongrel] Mongrel 1.1 In-Reply-To: <20071101131146.a49zlm9ib7z4g4o0@webmail.hotgazpacho.com> References: <683a886f0711010751l60653e3bvb73f4abe0e3a2713@mail.gmail.com> <20071101110616.0mmqpe194zk0ocs0@webmail.hotgazpacho.com> <20071101131146.a49zlm9ib7z4g4o0@webmail.hotgazpacho.com> Message-ID: The pure Ruby classifier is faster than the C classifier in the pathological case of only one handler (most Rails apps). They both scale linearly up to about 14 urls, at which point the C classifier performance curve goes flat. Hardly anybody uses that many handlers, so we dumped the 450 line Trie and C classifier for 30-odd lines of Ruby. This makes JRuby support much easier. But seriously, even 8ish urls, the performance penalty per request for the Ruby classifier is about 5 microseconds per request on a Mac Mini. When your app is returning requests in the 100 microsecond range, then maybe you should start to care; until then, no. The C classifier is still available in the mongrel_experimental gem; if you install it, it will automatically be used. Evan On Nov 1, 2007 1:11 PM, wrote: > Ah, well that makes sense! > > Thanks for clearing that up! > > > Quoting Kirk Haines : > > > On 11/1/07, will at hotgazpacho.com wrote: > >> I'm curious to know why the URL classifier was moved from C code to > >> Ruby code. I am under the impression that Ruby code is often much > >> slower than C extensions. I'm also under the impression that the URL > >> classifier is somewhere that speed would be desirable. > > > > C code will generally be faster than Ruby code, yes. > > > > The thing with the classifier is that for small numbers of urls to > > classify, the pure ruby solution is as fast or faster than the trie > > based C classifier, and the decision was made that the simplification > > represented by switching to a pure ruby solution there was a > > beneficial tradeoff, since most people do not have more than a dozen > > handlers registered with a mongrel instance, so for most people there > > will be no performance loss. > > > > > > Kirk Haines > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Evan Weaver Cloudburst, LLC From pete at nextengine.com Fri Nov 2 13:34:39 2007 From: pete at nextengine.com (Pete DeLaurentis) Date: Fri, 2 Nov 2007 10:34:39 -0700 Subject: [Mongrel] Server timeouts Message-ID: Hi guys, Does anyone know if mongrel has a built-in timeout for requests that take too long? If so, how do you increase it? I've found that some server requests are timing out. Complicated requests are already being farmed out to asynchronous processes. But some of the more basic requests are timing out when we have our peak server load in the mornings (the bottleneck is the database server). There are a couple possible locations for the timeout I'm seeing: 1. Mongrel 2. Lighttpd 3. Client browser / application On my local development server, it does not timeout, leading me to believe it's not #3. Any feedback is appreciated. Thanks, Pete From pete at nextengine.com Fri Nov 2 14:38:30 2007 From: pete at nextengine.com (Pete DeLaurentis) Date: Fri, 2 Nov 2007 11:38:30 -0700 Subject: [Mongrel] Server timeouts In-Reply-To: <20071102102916.1u6a2rkqp8owcws4@lcgalaska.com> References: <20071102102916.1u6a2rkqp8owcws4@lcgalaska.com> Message-ID: <501F2022-2E4D-4790-B3AB-834499509F4F@nextengine.com> Yeah, all the foreign keys are indexed. I'm also caching what I can in our ruby app's memory. It seems to be the database writes that are taking up a lot of the time. The other offender are some multiple JOINs we're doing. I've ordered more processors for the database server, and am clearing off a second machine so I can get a little MySQL cluster going. Any advice on this is welcome since I've never scaled a database server before. As the database gets faster, it will help reduce the timeouts. But demand + server load has a way of sneaking up on you. I'm looking for a way of making sure our server is less likely to timeout on users when we run into system bottlenecks (now + in the future). Thanks, Pete On Nov 2, 2007, at 11:29 AM, barsalou wrote: > Pete, > > What about the DB is the bottleneck? I'm assuming you have already > looked at indexing and the like. > > Mike B. > > Quoting Pete DeLaurentis : > >> Hi guys, >> >> Does anyone know if mongrel has a built-in timeout for requests that >> take too long? If so, how do you increase it? >> >> I've found that some server requests are timing out. Complicated >> requests are already being farmed out to asynchronous processes. But >> some of the more basic requests are timing out when we have our peak >> server load in the mornings (the bottleneck is the database server). >> >> There are a couple possible locations for the timeout I'm seeing: >> >> 1. Mongrel >> 2. Lighttpd >> 3. Client browser / application >> >> On my local development server, it does not timeout, leading me to >> believe it's not #3. >> >> Any feedback is appreciated. >> >> Thanks, >> Pete >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users >> > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. From barjunk at attglobal.net Fri Nov 2 14:29:16 2007 From: barjunk at attglobal.net (barsalou) Date: Fri, 02 Nov 2007 10:29:16 -0800 Subject: [Mongrel] Server timeouts In-Reply-To: References: Message-ID: <20071102102916.1u6a2rkqp8owcws4@lcgalaska.com> Pete, What about the DB is the bottleneck? I'm assuming you have already looked at indexing and the like. Mike B. Quoting Pete DeLaurentis : > Hi guys, > > Does anyone know if mongrel has a built-in timeout for requests that > take too long? If so, how do you increase it? > > I've found that some server requests are timing out. Complicated > requests are already being farmed out to asynchronous processes. But > some of the more basic requests are timing out when we have our peak > server load in the mornings (the bottleneck is the database server). > > There are a couple possible locations for the timeout I'm seeing: > > 1. Mongrel > 2. Lighttpd > 3. Client browser / application > > On my local development server, it does not timeout, leading me to > believe it's not #3. > > Any feedback is appreciated. > > Thanks, > Pete > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From barjunk at attglobal.net Fri Nov 2 18:26:27 2007 From: barjunk at attglobal.net (barsalou) Date: Fri, 02 Nov 2007 14:26:27 -0800 Subject: [Mongrel] Server timeouts In-Reply-To: <501F2022-2E4D-4790-B3AB-834499509F4F@nextengine.com> References: <20071102102916.1u6a2rkqp8owcws4@lcgalaska.com> <501F2022-2E4D-4790-B3AB-834499509F4F@nextengine.com> Message-ID: <20071102142627.hbns0uuy8ockocoo@lcgalaska.com> Pete, Quoting Pete DeLaurentis : > Yeah, all the foreign keys are indexed. I'm also caching what I can > in our ruby app's memory. > > It seems to be the database writes that are taking up a lot of the > time. The other offender are some multiple JOINs we're doing. > > I've ordered more processors for the database server, and am clearing > off a second machine so I can get a little MySQL cluster going. Any > advice on this is welcome since I've never scaled a database server > before. I've never done that either...what about memcached....or that's already similar to what you are doing in memory? We use it on one of our non-rails apps and it seems to do a good job of improving performance...I don't know or understand a huge amount about it, but thought I would bring it up. Maybe one of the "Smarter Folks" would be able to help out with that. Mike B. ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From dave at cheney.net Fri Nov 2 21:11:22 2007 From: dave at cheney.net (Dave Cheney) Date: Sat, 3 Nov 2007 12:11:22 +1100 Subject: [Mongrel] Server timeouts In-Reply-To: <501F2022-2E4D-4790-B3AB-834499509F4F@nextengine.com> References: <20071102102916.1u6a2rkqp8owcws4@lcgalaska.com> <501F2022-2E4D-4790-B3AB-834499509F4F@nextengine.com> Message-ID: Hi Pete, If you suspect queries are your pain point then I would do the following to get a sense of what you app is doing under the hood. Get a copy of http://hackmysql.com/mysqlreport and use it against your db. It can assist in tweaking innodb or myisam table configs. Turn on slow query logging, add the lines log_slow_queries=/usr/local/mysql/data/mysql-slow.log (adjust path as necessary) log-queries-not-using-indexes To your /etc/my.cnf and restart the db. This will log any query that takes longer than 1 second to run (will only spot the really heinous ones, in a busy web app a 1 second query is game over). This also logs queries which do not use and index, hence scale badly as your tables grow. Recent versions of linux have an excellent vmstat and iostat, have them running in a wind during busy times of the day and see how your db machine handles it. Is it really out of CPU, or does your dataset not fit in memory and you pulling huge blobs of data off the disk because of poorly specified queries, or worse spending it rashly by creating many temporary tables. I have found that time spent optimising db queries, and rethinking the datamodel to be more sql efficient pays off in the long run vs throwing hardware at the problem. Cheers Dave On 03/11/2007, at 5:38 AM, Pete DeLaurentis wrote: > Yeah, all the foreign keys are indexed. I'm also caching what I can > in our ruby app's memory. > > It seems to be the database writes that are taking up a lot of the > time. The other offender are some multiple JOINs we're doing. > > I've ordered more processors for the database server, and am clearing > off a second machine so I can get a little MySQL cluster going. Any > advice on this is welcome since I've never scaled a database server > before. > > As the database gets faster, it will help reduce the timeouts. But > demand + server load has a way of sneaking up on you. I'm looking > for a way of making sure our server is less likely to timeout on > users when we run into system bottlenecks (now + in the future). > > Thanks, > Pete > > > On Nov 2, 2007, at 11:29 AM, barsalou wrote: > >> Pete, >> >> What about the DB is the bottleneck? I'm assuming you have already >> looked at indexing and the like. >> >> Mike B. >> >> Quoting Pete DeLaurentis : >> >>> Hi guys, >>> >>> Does anyone know if mongrel has a built-in timeout for requests that >>> take too long? If so, how do you increase it? >>> >>> I've found that some server requests are timing out. Complicated >>> requests are already being farmed out to asynchronous processes. >>> But >>> some of the more basic requests are timing out when we have our peak >>> server load in the mornings (the bottleneck is the database server). >>> >>> There are a couple possible locations for the timeout I'm seeing: >>> >>> 1. Mongrel >>> 2. Lighttpd >>> 3. Client browser / application >>> >>> On my local development server, it does not timeout, leading me to >>> believe it's not #3. >>> >>> Any feedback is appreciated. >>> >>> Thanks, >>> Pete >>> _______________________________________________ >>> Mongrel-users mailing list >>> Mongrel-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/mongrel-users >>> >> >> >> >> ---------------------------------------------------------------- >> This message was sent using IMP, the Internet Messaging Program. > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From pete at nextengine.com Fri Nov 2 21:53:10 2007 From: pete at nextengine.com (Pete DeLaurentis) Date: Fri, 2 Nov 2007 18:53:10 -0700 Subject: [Mongrel] Server timeouts In-Reply-To: References: <20071102102916.1u6a2rkqp8owcws4@lcgalaska.com> <501F2022-2E4D-4790-B3AB-834499509F4F@nextengine.com> Message-ID: Thanks for the DB profiling tips Dave. From some basic top monitoring, I've seen that my server is topping out at 100% CPU. I'll check out mysqlreport and learn more about why it's using this kind of power. -Pete On Nov 2, 2007, at 6:11 PM, Dave Cheney wrote: > Hi Pete, > > If you suspect queries are your pain point then I would do the > following to get a sense of what you app is doing under the hood. > > Get a copy of http://hackmysql.com/mysqlreport and use it against > your db. It can assist in tweaking innodb or myisam table configs. > > Turn on slow query logging, add the lines > > log_slow_queries=/usr/local/mysql/data/mysql-slow.log (adjust path as > necessary) > log-queries-not-using-indexes > > To your /etc/my.cnf and restart the db. This will log any query that > takes longer than 1 second to run (will only spot the really heinous > ones, in a busy web app a 1 second query is game over). This also logs > queries which do not use and index, hence scale badly as your tables > grow. > > Recent versions of linux have an excellent vmstat and iostat, have > them running in a wind during busy times of the day and see how your > db machine handles it. Is it really out of CPU, or does your dataset > not fit in memory and you pulling huge blobs of data off the disk > because of poorly specified queries, or worse spending it rashly by > creating many temporary tables. > > I have found that time spent optimising db queries, and rethinking > the datamodel to be more sql efficient pays off in the long run vs > throwing hardware at the problem. > > Cheers > > Dave > > On 03/11/2007, at 5:38 AM, Pete DeLaurentis wrote: > >> Yeah, all the foreign keys are indexed. I'm also caching what I can >> in our ruby app's memory. >> >> It seems to be the database writes that are taking up a lot of the >> time. The other offender are some multiple JOINs we're doing. >> >> I've ordered more processors for the database server, and am clearing >> off a second machine so I can get a little MySQL cluster going. Any >> advice on this is welcome since I've never scaled a database server >> before. >> >> As the database gets faster, it will help reduce the timeouts. But >> demand + server load has a way of sneaking up on you. I'm looking >> for a way of making sure our server is less likely to timeout on >> users when we run into system bottlenecks (now + in the future). >> >> Thanks, >> Pete >> >> >> On Nov 2, 2007, at 11:29 AM, barsalou wrote: >> >>> Pete, >>> >>> What about the DB is the bottleneck? I'm assuming you have already >>> looked at indexing and the like. >>> >>> Mike B. >>> >>> Quoting Pete DeLaurentis : >>> >>>> Hi guys, >>>> >>>> Does anyone know if mongrel has a built-in timeout for requests >>>> that >>>> take too long? If so, how do you increase it? >>>> >>>> I've found that some server requests are timing out. Complicated >>>> requests are already being farmed out to asynchronous processes. >>>> But >>>> some of the more basic requests are timing out when we have our >>>> peak >>>> server load in the mornings (the bottleneck is the database >>>> server). >>>> >>>> There are a couple possible locations for the timeout I'm seeing: >>>> >>>> 1. Mongrel >>>> 2. Lighttpd >>>> 3. Client browser / application >>>> >>>> On my local development server, it does not timeout, leading me to >>>> believe it's not #3. >>>> >>>> Any feedback is appreciated. >>>> >>>> Thanks, >>>> Pete >>>> _______________________________________________ >>>> Mongrel-users mailing list >>>> Mongrel-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/mongrel-users >>>> >>> >>> >>> >>> ---------------------------------------------------------------- >>> This message was sent using IMP, the Internet Messaging Program. >> >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From pete at nextengine.com Fri Nov 2 21:57:10 2007 From: pete at nextengine.com (Pete DeLaurentis) Date: Fri, 2 Nov 2007 18:57:10 -0700 Subject: [Mongrel] Server timeouts In-Reply-To: <20071102142627.hbns0uuy8ockocoo@lcgalaska.com> References: <20071102102916.1u6a2rkqp8owcws4@lcgalaska.com> <501F2022-2E4D-4790-B3AB-834499509F4F@nextengine.com> <20071102142627.hbns0uuy8ockocoo@lcgalaska.com> Message-ID: <8F455407-E071-43B5-9D1A-BB8B8BA5621B@nextengine.com> Thanks Mike. You seem plenty smart enough to me... I used memcached for awhile, but found that the amount of non- changing stuff I had was really small. So, I switched this small amount of data to my rails process memory, and got a nice speed boost out of that. If I had larger amounts of constant data, then memcached would be a good bargain, because it would allow me to save memory in my individual processes. -Pete On Nov 2, 2007, at 3:26 PM, barsalou wrote: > Pete, Quoting Pete DeLaurentis : > >> Yeah, all the foreign keys are indexed. I'm also caching what I >> can in our ruby app's memory. >> >> It seems to be the database writes that are taking up a lot of >> the time. The other offender are some multiple JOINs we're doing. >> >> I've ordered more processors for the database server, and am >> clearing off a second machine so I can get a little MySQL cluster >> going. Any advice on this is welcome since I've never scaled a >> database server before. > > I've never done that either...what about memcached....or that's > already similar to what you are doing in memory? > > We use it on one of our non-rails apps and it seems to do a good > job of improving performance...I don't know or understand a huge > amount about it, but thought I would bring it up. > > Maybe one of the "Smarter Folks" would be able to help out with that. > > Mike B. > > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. From lists at ruby-forum.com Fri Nov 2 22:45:12 2007 From: lists at ruby-forum.com (Virtualoffice Virtualoffice) Date: Sat, 3 Nov 2007 03:45:12 +0100 Subject: [Mongrel] Only 50 USD/month - You own an office at HCMC, Vietnam. Message-ID: <15adffb2fadae440d4ba91a30e2284fc@ruby-forum.com> In Today's ever-changing business climate, speed and flexibility are essential for success. Our professional-designed workplaces provide business of all ages and stages with access to the most prestigious building in central of HoChiMinh City, Vietnam. Our premiere workplaces are truly business-ready. Come on, sit-down and start your business at our fully-furnished offices and meeting rooms. Without up-front capital expenditures and build infrastructure, with our Virtual Office you can save up to 90% compared to traditional office. - Virtual Office service: Prestigious local business address, local phone number answered in you company's name, managed to your instructions. - Office space service: Fully-furnished workplace comes with professional staff. On-demand IT and administrative support are available where and when you need. - Meeting rooms : with full equipped facilities to run productive meetings. Please see details: http://www.goffice.vn - Virtual office HCMC Vietnam, office space for rent, office solutions, office rental, rent office, business address hcm Visit our sites: http://www.goffice.vn/ Or Calling us: +( 84 - 8 ) 2200911 Attachments: http://www.ruby-forum.com/attachment/863/Indochina.jpg -- Posted via http://www.ruby-forum.com/. From eden at hulu.com Sat Nov 3 02:19:42 2007 From: eden at hulu.com (Eden Li) Date: Sat, 3 Nov 2007 14:19:42 +0800 Subject: [Mongrel] Mongrel Cluster: Rolling restart? Message-ID: <1dd361e10711022319v7414e79du1698a68576e6efa4@mail.gmail.com> Hi all, Forgive me if this has been asked before, but is there a reason mongrel_rails cluster::restart stops all ports and then restarts them again? Wouldn't it be better to restart each port one-by-one in series so that upstream proxy servers can fail over while the restart is occurring, or am I missing something? Thanks, eden From tiberiu.motoc at gmail.com Sun Nov 4 18:31:13 2007 From: tiberiu.motoc at gmail.com (Tiberiu Motoc) Date: Sun, 4 Nov 2007 15:31:13 -0800 Subject: [Mongrel] can't configure mongrel_cluster to start on boot Message-ID: <84ec458f0711041531s4324dbf7v85dbb4e886612b11@mail.gmail.com> Hi everyone, I've been working with Mongrel, Mongrel_cluster and Apache and it is great. However, I can't get mongrel_cluster to start at boot time. I followed the instructions from http://mongrel.rubyforge.org/docs/mongrel_cluster.html (On Boot Initialization Setup) and mongrel_cluster does not start after rebooting the machine. I made sure that the shebang line is correct and I also made sure that the mongrel_cluster_ctl location is in the PATH variable. Just to be on the safe side I created a symbolic link in /usr/bin and still no luck. The next thing I did was to trace the mongrel_cluster script. There is something strange about it, and I can't believe that nobody complained about it yet: the script takes an argument (start, stop or restart), but the instructions provided on the mongrel_cluster webpage do not pass any argument(s) to it. So, how is the script supposed to start? I'm not an expert on Linux admin, but is the chkconfig application supposed to pass "start" to the script? What about when the machine gets shut down, where in the script do we delete the mongrel pid files? (or worse, if it gets powered off, and if we restart without deleting the pid files, then the script won't even start the mongrel processes). Anyway, those are small things that can be easily changed in the script, so I hardcoded "start" in the script, and my script failed on the following line: which mongrel_cluster_ctl >/dev/null || exit 0 I commented out the line and provided the full path to mongrel_cluster_ctl. I dumped the $RETVAL into a log file (after calling mongrel_cluster_ctl) and it was 137. I don't know what else to do. I am logged in as admin, I successfully used chkconfig to add Apache to the boot script, and if I run the script manually - it works! Thanks, Tiberiu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071104/ee5cfd26/attachment.html From weigbin at 163.com Mon Nov 5 01:12:34 2007 From: weigbin at 163.com (=?GBK?B?zrq547Hy?=) Date: Mon, 5 Nov 2007 14:12:34 +0800 (CST) Subject: [Mongrel] deploy ruby on rails application by mongrel Message-ID: <20543864.254171194243154890.JavaMail.coremail@bj163app17.163.com> 1.download ruby-one click for windows from www.ruby-lang.org? set up. 2.run command: gem install rails --include-dependencies (success) 3.set up mongrel: gem install win32-service(pick the most recent one) gem install mongrel (pick the win32 pre-built) gem install mongrel_service all of the above were successful. then i creat an empty folder "d:\myapp",run the command: mongrel_rails service::install -N myapp -c d:\myapp -p 4000 -e production the rusult:the path you specified isn't a valid Rails application so what's the matter? i am a student in Nanjing Agricultural University,I am learning ruby and ruby on rails,but there are few books and other materials for me.so can you help me? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/7117c793/attachment.html From gregbclarke at gmail.com Mon Nov 5 01:38:40 2007 From: gregbclarke at gmail.com (Greg Clarke) Date: Mon, 5 Nov 2007 17:38:40 +1100 Subject: [Mongrel] deploy ruby on rails application by mongrel In-Reply-To: <20543864.254171194243154890.JavaMail.coremail@bj163app17.163.com> References: <20543864.254171194243154890.JavaMail.coremail@bj163app17.163.com> Message-ID: I think you might have missed out the step where you create a valid rails application. After all the gem installs, you should be able to enter: rails myapp and that command will set up a valid rails directory. You should possibly make sure you understand how the rails command works first, and use the 'mongrel_rails start' and 'mongrel_rails stop' commands while learning Rails. On 11/5/07, ??? wrote: > > 1.download ruby-one click for windows from www.ruby-lang.org? set up. > 2.run command: > gem install rails --include-dependencies (success) > 3.set up mongrel: > gem install win32-service(pick the most recent one) > gem install mongrel (pick the win32 pre-built) > gem install mongrel_service > > all of the above were successful. > > then i creat an empty folder "d:\myapp",run the command: > mongrel_rails service::install -N myapp -c d:\myapp -p 4000 -e > production > > the rusult:the path you specified isn't a valid Rails application > > so what's the matter? > > i am a student in Nanjing Agricultural University,I am learning ruby and > ruby on rails,but there are few books and other materials for me.so can > you help me? > > > ------------------------------ > [image: LOGO] ???????????????? > ?????????????? > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/4d4c3d23/attachment-0001.html From thomas.tmp at gmail.com Mon Nov 5 05:21:15 2007 From: thomas.tmp at gmail.com (Thomas Balthazar) Date: Mon, 5 Nov 2007 11:21:15 +0100 Subject: [Mongrel] Mongrel and memory usage Message-ID: Hello, I'm running a Rails application which must sort and manipulate a lot of data which are loaded in memory. The Rails app runs on 2 mongrel processes. When I first load the app, both are 32Mb in memory. After some days, both are between 200Mb and 300Mb. My question is : is there some kind of garbage collector in Mongrel? I never see the two Mongrel processes memory footprint decrease. Is it normal? I use Mongrel 1.0.1 with Rails 1.2.3 on Debian. Best regards, Thomas. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/19c99906/attachment.html From barunio at gmail.com Mon Nov 5 06:00:12 2007 From: barunio at gmail.com (Barun Singh) Date: Mon, 5 Nov 2007 06:00:12 -0500 Subject: [Mongrel] mongrel not finding correct ruby path Message-ID: <83e853830711050300o22dd05b6n75c8521e58633015@mail.gmail.com> hello all, i have been trying to figure this out for the last few hours, and after seemingly exhausting all the google search results, i figured i would try this mailing list... i just updated the ruby version on my ubuntu dapper drake box to the most recent version. i installed it into /usr/local/bin problematically, the previous installation was in /usr/bin mongrel still complains that: "Ruby version is not up-to-date; loading cgi_multipart_eof_fix" from looking at /usr/bin/mongrel_rails, i can see that the first line of the file is: #!/usr/bin/ruby1.8 which is the old version of ruby (1.8.4) I tried changing the shebang to the correct path of #!/usr/local/bin/ruby but then it gave me an error that it couldn't find "rubygems" every other method i could think of to have it point to the right place (such as moving the new ruby binary into the /usr/bin directory along with the rdoc, ri, etc. files) all resulted in the same problem with rubygems not being found. does anyone have any idea how i can get mongrel to see the correct, updated version of ruby?? thanks... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/731180e1/attachment.html From gregbclarke at gmail.com Mon Nov 5 06:19:05 2007 From: gregbclarke at gmail.com (Greg Clarke) Date: Mon, 5 Nov 2007 22:19:05 +1100 Subject: [Mongrel] mongrel not finding correct ruby path In-Reply-To: <83e853830711050300o22dd05b6n75c8521e58633015@mail.gmail.com> References: <83e853830711050300o22dd05b6n75c8521e58633015@mail.gmail.com> Message-ID: Have you installed rubygems in your new ruby installation? See here, http://www.rubyonrails.org/down, where the first step after installing ruby is to install rubygems. This is where rubygems sits in my 1.8.6 ruby install: /usr/local/lib/ruby/site_ruby/1.8/rubygems So, maybe you need to check your $PATH, check ruby -v , then install rubygems. GC On 11/5/07, Barun Singh wrote: > hello all, > > i have been trying to figure this out for the last few hours, and after > seemingly exhausting all the google search results, i figured i would try > this mailing list... > > i just updated the ruby version on my ubuntu dapper drake box to the most > recent version. i installed it into /usr/local/bin > problematically, the previous installation was in /usr/bin > mongrel still complains that: > "Ruby version is not up-to-date; loading cgi_multipart_eof_fix" > > from looking at /usr/bin/mongrel_rails, i can see that the first line of the > file is: > #!/usr/bin/ruby1.8 > which is the old version of ruby (1.8.4) > I tried changing the shebang to the correct path of > #!/usr/local/bin/ruby > but then it gave me an error that it couldn't find "rubygems" > > every other method i could think of to have it point to the right place > (such as moving the new ruby binary into the /usr/bin directory along with > the rdoc, ri, etc. files) all resulted in the same problem with rubygems not > being found. > > does anyone have any idea how i can get mongrel to see the correct, updated > version of ruby?? > > thanks... > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From lists at ruby-forum.com Mon Nov 5 08:27:21 2007 From: lists at ruby-forum.com (Reinaldo Mello) Date: Mon, 5 Nov 2007 14:27:21 +0100 Subject: [Mongrel] Mongrel + Apache 2.2 Content-Length Message-ID: Hi. I have a mongrel+apache2.2 config running. It happens that one of our partners request a response body containing ONLY one char. It happens that they reported me that sometimes (!) my response was going like this: ================================ <- this line is to separate this text HTTP/1.1 200 OK Date: Sat, 03 Nov 2007 23:12:16 GMT Server: Mongrel 1.0.1 Status: 200 OK Cache-Control: no-cache Content-Type: text/plain; charset=ISO-8859-1 Content-Length: 1 Vary: Accept-Encoding Connection: close 0 ================================ <- this line is to separate this text Although the content-length is set to 1, mongrel (or apache) inserted double line breaks before the original response (as set on rails -> 0) Can anyone help? Thanks in advance Reinaldo -- Posted via http://www.ruby-forum.com/. From g.vishnu at gmail.com Mon Nov 5 09:29:30 2007 From: g.vishnu at gmail.com (Vishnu Gopal) Date: Mon, 5 Nov 2007 19:59:30 +0530 Subject: [Mongrel] mongrel not finding correct ruby path In-Reply-To: References: <83e853830711050300o22dd05b6n75c8521e58633015@mail.gmail.com> Message-ID: You can point GEM_HOME to your old rubygems folder and it should work. Vish On 11/5/07, Greg Clarke wrote: > > Have you installed rubygems in your new ruby installation? > > See here, http://www.rubyonrails.org/down, where the first step after > installing ruby is to install rubygems. > > This is where rubygems sits in my 1.8.6 ruby install: > /usr/local/lib/ruby/site_ruby/1.8/rubygems > > So, maybe you need to check your $PATH, check ruby -v , then install > rubygems. > > > GC > > > > On 11/5/07, Barun Singh wrote: > > hello all, > > > > i have been trying to figure this out for the last few hours, and after > > seemingly exhausting all the google search results, i figured i would > try > > this mailing list... > > > > i just updated the ruby version on my ubuntu dapper drake box to the > most > > recent version. i installed it into /usr/local/bin > > problematically, the previous installation was in /usr/bin > > mongrel still complains that: > > "Ruby version is not up-to-date; loading cgi_multipart_eof_fix" > > > > from looking at /usr/bin/mongrel_rails, i can see that the first line of > the > > file is: > > #!/usr/bin/ruby1.8 > > which is the old version of ruby (1.8.4) > > I tried changing the shebang to the correct path of > > #!/usr/local/bin/ruby > > but then it gave me an error that it couldn't find "rubygems" > > > > every other method i could think of to have it point to the right place > > (such as moving the new ruby binary into the /usr/bin directory along > with > > the rdoc, ri, etc. files) all resulted in the same problem with rubygems > not > > being found. > > > > does anyone have any idea how i can get mongrel to see the correct, > updated > > version of ruby?? > > > > thanks... > > > > > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/98eccbac/attachment.html From wyhaines at gmail.com Mon Nov 5 10:21:56 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Mon, 5 Nov 2007 08:21:56 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: Message-ID: On 11/5/07, Thomas Balthazar wrote: > I'm running a Rails application which must sort and manipulate a lot of data > which are loaded in memory. > The Rails app runs on 2 mongrel processes. > When I first load the app, both are 32Mb in memory. > After some days, both are between 200Mb and 300Mb. > > My question is : is there some kind of garbage collector in Mongrel? > I never see the two Mongrel processes memory footprint decrease. > Is it normal? Ruby is a garbage collected language. Ruby has a conservative mark and sweep garbage collector. Memory usage like that is probably not a Mongrel issue (unless you are generating _very_ large responses in your application). It's likely an issue with your code. What version of Ruby are you using? Are you using any extensions? Kirk Haines From bpenrose112 at hotmail.com Mon Nov 5 10:39:08 2007 From: bpenrose112 at hotmail.com (Brian Penrose) Date: Mon, 5 Nov 2007 10:39:08 -0500 Subject: [Mongrel] Error installing Mongrel on Solaris 9 Message-ID: Hi all, We've installed RoR on Solaris 9, and are attempting to install Mongrel using the following command:gem install mongrelgetting error "SSL is not installed on this system".All other gems (including Rake) installed fine.Any suggestions?Thanks,Brian _________________________________________________________________ Boo!?Scare away worms, viruses and so much more! Try Windows Live OneCare! http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/8af098bc/attachment.html From luislavena at gmail.com Mon Nov 5 10:55:03 2007 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 5 Nov 2007 12:55:03 -0300 Subject: [Mongrel] Error installing Mongrel on Solaris 9 In-Reply-To: References: Message-ID: <71166b3b0711050755u131cdb9eu604ff7f854df53d6@mail.gmail.com> On 11/5/07, Brian Penrose wrote: > > > Hi all, > > We've installed RoR on Solaris 9, and are attempting to install Mongrel > using the following command: > > gem install mongrel > > getting error "SSL is not installed on this system". > > All other gems (including Rake) installed fine. > > Any suggestions? > Latest mongrel gems are "signed", in that way you are sure is our gem and noone else. RubyGems shouldn't yell at you about missing OpenSSL since you didn't use the "-P HighSecurity" parameter, or did you? -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From alexey.verkhovsky at gmail.com Mon Nov 5 10:55:34 2007 From: alexey.verkhovsky at gmail.com (Alexey Verkhovsky) Date: Mon, 5 Nov 2007 09:55:34 -0600 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: Message-ID: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> On 11/5/07, Kirk Haines wrote: > On 11/5/07, Thomas Balthazar wrote: > > I never see the two Mongrel processes memory footprint decrease. > > Is it normal? > Ruby is a garbage collected language. Ruby has a conservative mark > and sweep garbage collector. But Ruby processes never release memory back to the operating system. So, the fact that its RSS never goes down is normal. In normal circumstances, Mongrel should grow up to some point around 60-120 Mb and stay there. 300 Mb and growing is a sure sign you have a memory leak somewhere. -- Alexey Verkhovsky CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com] RubyWorks [http://rubyworks.thoughtworks.com] From thomas.tmp at gmail.com Mon Nov 5 11:06:01 2007 From: thomas.tmp at gmail.com (Thomas Balthazar) Date: Mon, 5 Nov 2007 17:06:01 +0100 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: Message-ID: On 11/5/07, Kirk Haines wrote: > > On 11/5/07, Thomas Balthazar wrote: > > > I'm running a Rails application which must sort and manipulate a lot of > data > > which are loaded in memory. > > The Rails app runs on 2 mongrel processes. > > When I first load the app, both are 32Mb in memory. > > After some days, both are between 200Mb and 300Mb. > > > > My question is : is there some kind of garbage collector in Mongrel? > > I never see the two Mongrel processes memory footprint decrease. > > Is it normal? > > Ruby is a garbage collected language. Ruby has a conservative mark > and sweep garbage collector. > > Memory usage like that is probably not a Mongrel issue (unless you are > generating _very_ large responses in your application). It's likely > an issue with your code. What version of Ruby are you using? Are you > using any extensions? > > > Kirk Haines > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users Hello Kirk, Thanks for your answer. I'm using ruby 1.8.5 (2006-08-25) [i486-linux]. The Rails app uses those plugins : * acts_as_taggable_on_steroids * attachment_fu * exception_notification * localization Which kink of issues with my code could use that much memory? If I load lots of records with Active Records, aren't they "unloaded" at some times? Thanks in advance for your help. Thomas. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/76ef2707/attachment.html From thomas.tmp at gmail.com Mon Nov 5 11:09:54 2007 From: thomas.tmp at gmail.com (Thomas Balthazar) Date: Mon, 5 Nov 2007 17:09:54 +0100 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> References: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> Message-ID: On 11/5/07, Alexey Verkhovsky wrote: > On 11/5/07, Kirk Haines wrote: > > On 11/5/07, Thomas Balthazar wrote: > > > I never see the two Mongrel processes memory footprint decrease. > > > Is it normal? > > Ruby is a garbage collected language. Ruby has a conservative mark > > and sweep garbage collector. > > But Ruby processes never release memory back to the operating system. > So, the fact that its RSS never goes down is normal. > > In normal circumstances, Mongrel should grow up to some point around > 60-120 Mb and stay there. 300 Mb and growing is a sure sign you have a > memory leak somewhere. > > -- > Alexey Verkhovsky > CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com] > RubyWorks [http://rubyworks.thoughtworks.com] > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > Hello Alexey, > 300 Mb and growing is a sure sign you have a memory leak somewhere. What would you suggest me to investigate? Thanks, Thomas. From wyhaines at gmail.com Mon Nov 5 11:18:51 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Mon, 5 Nov 2007 09:18:51 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: Message-ID: On 11/5/07, Thomas Balthazar wrote: > Thanks for your answer. > I'm using ruby 1.8.5 (2006-08-25) [i486-linux]. > The Rails app uses those plugins : > * acts_as_taggable_on_steroids > * attachment_fu > * exception_notification > * localization > > > Which kink of issues with my code could use that much memory? > If I load lots of records with Active Records, aren't they "unloaded" at > some times? Does your code or any of those pluginx use Array#shift? There was a bug with Array#shift which still existed in 1.8.5 which basically left stuff inside the array data structure after a shift, so that those things didn't get GCd when they should have. It's a sneaky bug that can easily eat a lot of memory. Otherwise, can you start a test instance of your application, and then test it to see if there are certain actions which cause the memory growth. That would help you pinpoint where the likely problems are. Just use ab or httperf to send a large number of requests to specific urls in your app, and see how ram usage changes as you do that. Kirk Haines From rob at robmela.com Mon Nov 5 11:20:13 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 05 Nov 2007 11:20:13 -0500 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: Message-ID: <472F42BD.4000500@robmela.com> We're seeing that all the time with our Rails apps. I'm looking at four processes right now in the 700 to 900MB range. My first guess is that it's something in Rails or our app. After all, that's where most of the code is. You might try running requests through WEBrick on a test server to see if the leak still occurs. If so, then you know at least part of it is Rails. There's always nightly restarts ;) Not my choice on how to do things, but hey, it'll have to hold till I can fix bigger things. What's the Ruby GC like? Circular references a problem? Thomas Balthazar wrote: > Hello, > > I'm running a Rails application which must sort and manipulate a lot > of data which are loaded in memory. > The Rails app runs on 2 mongrel processes. > When I first load the app, both are 32Mb in memory. > After some days, both are between 200Mb and 300Mb. > > My question is : is there some kind of garbage collector in Mongrel? > I never see the two Mongrel processes memory footprint decrease. > Is it normal? > > I use Mongrel 1.0.1 with Rails 1.2.3 on Debian. > > Best regards, > Thomas. > > ------------------------------------------------------------------------ > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/f0ed284a/attachment.vcf From pete at nextengine.com Mon Nov 5 11:22:28 2007 From: pete at nextengine.com (Pete DeLaurentis) Date: Mon, 5 Nov 2007 08:22:28 -0800 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> Message-ID: Hi guys, Along the lines of Thomas question, I've noticed that my mongrel rails processes start at around 50 MB, and creep up to around 100 MB (or a little over) pretty soon after being used. Is this something other folks are seeing (i.e. standard rails overhead), or does it sound specific to my app? Also, if anyone has any tips on finding memory leaks in mongrel, they'd be much appreciated. I've played with watching the ObjectSpace. Is this the best way? Kirk: thanks for the tip on Array.shift with Ruby 1.8.5. I'll keep an eye out for this. Thanks, Pete On Nov 5, 2007, at 8:09 AM, Thomas Balthazar wrote: > On 11/5/07, Alexey Verkhovsky wrote: >> On 11/5/07, Kirk Haines wrote: >>> On 11/5/07, Thomas Balthazar wrote: >>>> I never see the two Mongrel processes memory footprint decrease. >>>> Is it normal? >>> Ruby is a garbage collected language. Ruby has a conservative mark >>> and sweep garbage collector. >> >> But Ruby processes never release memory back to the operating system. >> So, the fact that its RSS never goes down is normal. >> >> In normal circumstances, Mongrel should grow up to some point around >> 60-120 Mb and stay there. 300 Mb and growing is a sure sign you >> have a >> memory leak somewhere. >> >> -- >> Alexey Verkhovsky >> CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com] >> RubyWorks [http://rubyworks.thoughtworks.com] >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users >> > > Hello Alexey, > >> 300 Mb and growing is a sure sign you have a memory leak somewhere. > > What would you suggest me to investigate? > > Thanks, > Thomas. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From bpenrose112 at hotmail.com Mon Nov 5 11:31:44 2007 From: bpenrose112 at hotmail.com (Brian Penrose) Date: Mon, 5 Nov 2007 11:31:44 -0500 Subject: [Mongrel] Error installing Mongrel on Solaris 9 In-Reply-To: <71166b3b0711050755u131cdb9eu604ff7f854df53d6@mail.gmail.com> References: <71166b3b0711050755u131cdb9eu604ff7f854df53d6@mail.gmail.com> Message-ID: Hi Luis, Nope...didn't use the -P HighSecurity" parameter. Thanks, Brian > Date: Mon, 5 Nov 2007 12:55:03 -0300 > From: luislavena at gmail.com > To: mongrel-users at rubyforge.org > Subject: Re: [Mongrel] Error installing Mongrel on Solaris 9 > > On 11/5/07, Brian Penrose wrote: > > > > > > Hi all, > > > > We've installed RoR on Solaris 9, and are attempting to install Mongrel > > using the following command: > > > > gem install mongrel > > > > getting error "SSL is not installed on this system". > > > > All other gems (including Rake) installed fine. > > > > Any suggestions? > > > > Latest mongrel gems are "signed", in that way you are sure is our gem > and noone else. > > RubyGems shouldn't yell at you about missing OpenSSL since you didn't > use the "-P HighSecurity" parameter, or did you? > > -- > Luis Lavena > Multimedia systems > - > Leaders are made, they are not born. They are made by hard effort, > which is the price which all of us must pay to achieve any goal that > is worthwhile. > Vince Lombardi > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users _________________________________________________________________ Boo!?Scare away worms, viruses and so much more! Try Windows Live OneCare! http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/b7207220/attachment.html From luislavena at gmail.com Mon Nov 5 11:39:26 2007 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 5 Nov 2007 13:39:26 -0300 Subject: [Mongrel] Error installing Mongrel on Solaris 9 In-Reply-To: References: <71166b3b0711050755u131cdb9eu604ff7f854df53d6@mail.gmail.com> Message-ID: <71166b3b0711050839l3c39862eib4dc29b411d11226@mail.gmail.com> On 11/5/07, Brian Penrose wrote: > > > Hi Luis, > > Nope...didn't use the -P HighSecurity" parameter. > Ok, that means that actually RubyGems is using SSL even you didn't asked for it... I'll try to recreate the scenario later today and maybe submit a patch for rubygems. You don't have alternative or don't want to install SSL? -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From wyhaines at gmail.com Mon Nov 5 12:17:51 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Mon, 5 Nov 2007 10:17:51 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> Message-ID: On 11/5/07, Pete DeLaurentis wrote: > Hi guys, > > Along the lines of Thomas question, I've noticed that my mongrel > rails processes start at around 50 MB, and creep up to around 100 MB > (or a little over) pretty soon after being used. Is this something > other folks are seeing (i.e. standard rails overhead), or does it > sound specific to my app? There is probably a jump after the first request, then a slow creep upward for a bit, then it should stabilize. If it never stabilizes, then you have something in your code somewhere which is leaking. > Also, if anyone has any tips on finding memory leaks in mongrel, > they'd be much appreciated. I've played with watching the > ObjectSpace. Is this the best way? There are some tools that help, but yeah, mostly it's by using objectspace and looking through your code. If the code uses an extension, it's easy for an extension to have a leak that doesn't show up so easily, though. I originally found the Array#shift leak by using valgrind on Ruby, since all of that is C code. > Kirk: thanks for the tip on Array.shift with Ruby 1.8.5. I'll keep > an eye out for this. If this bites you, you can migrate to the most recent 1.8.6, or you can change your code to not use shift. Generally when shift is used, push is being used to stick things on one end of the array while shift pulls them off the front. Changing that to use unshift and pop gets around the problem. Kirk Haines From alexey.verkhovsky at gmail.com Mon Nov 5 12:25:21 2007 From: alexey.verkhovsky at gmail.com (Alexey Verkhovsky) Date: Mon, 5 Nov 2007 10:25:21 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> Message-ID: <3945c4270711050925m5f6fa5dao3bfc15f4d700167e@mail.gmail.com> On 11/5/07, Pete DeLaurentis wrote: > Along the lines of Thomas question, I've noticed that my mongrel > rails processes start at around 50 MB, and creep up to around 100 MB Set --num-procs lower than default 1024, and it won't be happening. -- Alexey Verkhovsky CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com] RubyWorks [http://rubyworks.thoughtworks.com] From bpenrose112 at hotmail.com Mon Nov 5 12:36:39 2007 From: bpenrose112 at hotmail.com (Brian Penrose) Date: Mon, 5 Nov 2007 12:36:39 -0500 Subject: [Mongrel] Error installing Mongrel on Solaris 9 In-Reply-To: <71166b3b0711050839l3c39862eib4dc29b411d11226@mail.gmail.com> References: <71166b3b0711050755u131cdb9eu604ff7f854df53d6@mail.gmail.com> <71166b3b0711050839l3c39862eib4dc29b411d11226@mail.gmail.com> Message-ID: Sorry for my ignorance, but how would we install SSL library for Ruby? > Date: Mon, 5 Nov 2007 13:39:26 -0300 > From: luislavena at gmail.com > To: mongrel-users at rubyforge.org > Subject: Re: [Mongrel] Error installing Mongrel on Solaris 9 > > On 11/5/07, Brian Penrose wrote: > > > > > > Hi Luis, > > > > Nope...didn't use the -P HighSecurity" parameter. > > > > Ok, that means that actually RubyGems is using SSL even you didn't > asked for it... > > I'll try to recreate the scenario later today and maybe submit a patch > for rubygems. > > You don't have alternative or don't want to install SSL? > > -- > Luis Lavena > Multimedia systems > - > Leaders are made, they are not born. They are made by hard effort, > which is the price which all of us must pay to achieve any goal that > is worthwhile. > Vince Lombardi > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users _________________________________________________________________ Windows Live Hotmail and Microsoft Office Outlook ? together at last. ?Get it now. http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/73db04b9/attachment.html From wyhaines at gmail.com Mon Nov 5 12:38:15 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Mon, 5 Nov 2007 10:38:15 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: <3945c4270711050925m5f6fa5dao3bfc15f4d700167e@mail.gmail.com> References: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> <3945c4270711050925m5f6fa5dao3bfc15f4d700167e@mail.gmail.com> Message-ID: On 11/5/07, Alexey Verkhovsky wrote: > On 11/5/07, Pete DeLaurentis wrote: > > Along the lines of Thomas question, I've noticed that my mongrel > > rails processes start at around 50 MB, and creep up to around 100 MB > > Set --num-procs lower than default 1024, and it won't be happening. It depends. One cause of that sort of creeping mem usage is having an app that sees large numbers of concurrent threads, as you know, but it's not the only cause. If concurrent threads ARE a mem usage problem, one might try using evented_mongrel out of the Swiftiply package. http://swiftiply.swiftcore.org Just run it in a test environment and see if it helps. For some apps, it makes a big difference in that thread related RAM creep. Kirk Haines P.S. Yes, I WILL have the patch to fix it for Mongrel > 1.0.1 today. The end of my week/weekend got very busy with things that don't involve computer screens. From public at misuse.org Mon Nov 5 13:05:00 2007 From: public at misuse.org (Steve Midgley) Date: Mon, 05 Nov 2007 10:05:00 -0800 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: Message-ID: <20071105180510.02A331858641@rubyforge.org> At 09:17 AM 11/5/2007, you wrote: > > Which kink of issues with my code could use that much memory? > > If I load lots of records with Active Records, aren't they > "unloaded" at > > some times? > >Does your code or any of those pluginx use Array#shift? There was a >bug with Array#shift which still existed in 1.8.5 which basically left >stuff inside the array data structure after a shift, so that those >things didn't get GCd when they should have. It's a sneaky bug that >can easily eat a lot of memory. > >Otherwise, can you start a test instance of your application, and then >test it to see if there are certain actions which cause the memory >growth. That would help you pinpoint where the likely problems are. >Just use ab or httperf to send a large number of requests to specific >urls in your app, and see how ram usage changes as you do that. > > >Kirk Haines Thanks Kirk - I guess I'm totally OT at this point, but I hadn't heard about this bug before. From your description this is a specific problem to the underlying C code implementing shift, which is not found in related functions? So "array.slice!(0)" would be identical in function to shift but not contain this leak? Thanks again, Steve From jamie at dangosaur.us Mon Nov 5 12:45:08 2007 From: jamie at dangosaur.us (Jamie Orchard-Hays) Date: Mon, 5 Nov 2007 12:45:08 -0500 Subject: [Mongrel] Error installing Mongrel on Solaris 9 In-Reply-To: References: <71166b3b0711050755u131cdb9eu604ff7f854df53d6@mail.gmail.com> <71166b3b0711050839l3c39862eib4dc29b411d11226@mail.gmail.com> Message-ID: <8F3492D9-0489-4F23-B7A2-35FF50B0A7B2@dangosaur.us> Brian, I've dealt with Solaris 8 and 10 installations. I generally use the Blastwave package system to get what I need. It's not up to par with most Linux and FreeBSD package systems, but easier than the default Solaris stuff. Jamie On Nov 5, 2007, at 12:36 PM, Brian Penrose wrote: > Sorry for my ignorance, but how would we install SSL library for Ruby? > > > > Date: Mon, 5 Nov 2007 13:39:26 -0300 > > From: luislavena at gmail.com > > To: mongrel-users at rubyforge.org > > Subject: Re: [Mongrel] Error installing Mongrel on Solaris 9 > > > > On 11/5/07, Brian Penrose wrote: > > > > > > > > > Hi Luis, > > > > > > Nope...didn't use the -P HighSecurity" parameter. > > > > > > > Ok, that means that actually RubyGems is using SSL even you didn't > > asked for it... > > > > I'll try to recreate the scenario later today and maybe submit a > patch > > for rubygems. > > > > You don't have alternative or don't want to install SSL? > > > > -- > > Luis Lavena > > Multimedia systems > > - > > Leaders are made, they are not born. They are made by hard effort, > > which is the price which all of us must pay to achieve any goal that > > is worthwhile. > > Vince Lombardi > > _______________________________________________ > > Mongrel-users mailing list > > Mongrel-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-users > > Windows Live Hotmail and Microsoft Office Outlook ? together at > last. Get it now! > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/592fb356/attachment.html From thomas.tmp at gmail.com Mon Nov 5 13:27:33 2007 From: thomas.tmp at gmail.com (Thomas Balthazar) Date: Mon, 5 Nov 2007 19:27:33 +0100 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: <20071105180510.02A331858641@rubyforge.org> References: <20071105180510.02A331858641@rubyforge.org> Message-ID: On 11/5/07, Steve Midgley wrote: > At 09:17 AM 11/5/2007, you wrote: > > > Which kink of issues with my code could use that much memory? > > > If I load lots of records with Active Records, aren't they > > "unloaded" at > > > some times? > > > >Does your code or any of those pluginx use Array#shift? There was a > >bug with Array#shift which still existed in 1.8.5 which basically left > >stuff inside the array data structure after a shift, so that those > >things didn't get GCd when they should have. It's a sneaky bug that > >can easily eat a lot of memory. > > > >Otherwise, can you start a test instance of your application, and then > >test it to see if there are certain actions which cause the memory > >growth. That would help you pinpoint where the likely problems are. > >Just use ab or httperf to send a large number of requests to specific > >urls in your app, and see how ram usage changes as you do that. > > > > > >Kirk Haines > > Thanks Kirk - I guess I'm totally OT at this point, but I hadn't heard > about this bug before. From your description this is a specific problem > to the underlying C code implementing shift, which is not found in > related functions? So "array.slice!(0)" would be identical in function > to shift but not contain this leak? > > Thanks again, > > Steve > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > Hello, Thanks everybody for all those informations. I'll make some tests and I'll keep you posted. I won't have the time to run those tests this week, but I won't forget to post the results on the list. Best, Thomas. From wyhaines at gmail.com Mon Nov 5 13:38:48 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Mon, 5 Nov 2007 11:38:48 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: <20071105180510.02A331858641@rubyforge.org> References: <20071105180510.02A331858641@rubyforge.org> Message-ID: On 11/5/07, Steve Midgley wrote: > Thanks Kirk - I guess I'm totally OT at this point, but I hadn't heard > about this bug before. From your description this is a specific problem > to the underlying C code implementing shift, which is not found in > related functions? So "array.slice!(0)" would be identical in function > to shift but not contain this leak? Yeah. It looked to me like whoever wrote the original array.c code just forgot something when writing the code, because it's just #shift that has the problem. This bug was fixed, but not until 1.8.6. I know it is fixed as of at least the last couple of patch releases. I am unsure if it was fixed in the original 1.8.6 release, however. Kirk Haines From pete at nextengine.com Mon Nov 5 13:55:04 2007 From: pete at nextengine.com (Pete DeLaurentis) Date: Mon, 5 Nov 2007 10:55:04 -0800 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: <3945c4270711050925m5f6fa5dao3bfc15f4d700167e@mail.gmail.com> References: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> <3945c4270711050925m5f6fa5dao3bfc15f4d700167e@mail.gmail.com> Message-ID: <41E85416-EC6D-4404-A9D2-F83A5F03A124@nextengine.com> What is a good value for --num-procs for rails applications, since these are single threaded? Does it depend on how fast the application responds to users? Thanks, Pete On Nov 5, 2007, at 9:25 AM, Alexey Verkhovsky wrote: > On 11/5/07, Pete DeLaurentis wrote: >> Along the lines of Thomas question, I've noticed that my mongrel >> rails processes start at around 50 MB, and creep up to around 100 MB > > Set --num-procs lower than default 1024, and it won't be happening. > > -- > Alexey Verkhovsky > CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com] > RubyWorks [http://rubyworks.thoughtworks.com] > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From wyhaines at gmail.com Mon Nov 5 14:02:53 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Mon, 5 Nov 2007 12:02:53 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: <41E85416-EC6D-4404-A9D2-F83A5F03A124@nextengine.com> References: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> <3945c4270711050925m5f6fa5dao3bfc15f4d700167e@mail.gmail.com> <41E85416-EC6D-4404-A9D2-F83A5F03A124@nextengine.com> Message-ID: On 11/5/07, Pete DeLaurentis wrote: > What is a good value for --num-procs for rails applications, since > these are single threaded? Does it depend on how fast the > application responds to users? It's application specific. Your sweet spot is going to be big enough that you don't experience capacity starvation during load bursts when you have temporary periods where more traffic is coming in than you are clearing, but small enough that you don't waste resources. Experimentation will probably be required to find the best balance. If you try evented_mongrel, you don't need to worry about num_procs. It's irrelevant for the evented_mongrel. Kirk Haines From bpenrose112 at hotmail.com Mon Nov 5 14:09:33 2007 From: bpenrose112 at hotmail.com (Brian Penrose) Date: Mon, 5 Nov 2007 14:09:33 -0500 Subject: [Mongrel] Error installing Mongrel on Solaris 9 In-Reply-To: <8F3492D9-0489-4F23-B7A2-35FF50B0A7B2@dangosaur.us> References: <71166b3b0711050755u131cdb9eu604ff7f854df53d6@mail.gmail.com> <71166b3b0711050839l3c39862eib4dc29b411d11226@mail.gmail.com> <8F3492D9-0489-4F23-B7A2-35FF50B0A7B2@dangosaur.us> Message-ID: For reasons beyond my control, I cannot install blastwave software on our system. However, I am seeing openssl files in both the Ruby (/var/ruby/ruby-1.8.6/ext) and Sun directories. Does this mean that it is installed and just needs configured? From: jamie at dangosaur.usDate: Mon, 5 Nov 2007 12:45:08 -0500To: mongrel-users at rubyforge.orgSubject: Re: [Mongrel] Error installing Mongrel on Solaris 9Brian, I've dealt with Solaris 8 and 10 installations. I generally use the Blastwave package system to get what I need. It's not up to par with most Linux and FreeBSD package systems, but easier than the default Solaris stuff. Jamie On Nov 5, 2007, at 12:36 PM, Brian Penrose wrote: Sorry for my ignorance, but how would we install SSL library for Ruby?> Date: Mon, 5 Nov 2007 13:39:26 -0300> From: luislavena at gmail.com> To: mongrel-users at rubyforge.org> Subject: Re: [Mongrel] Error installing Mongrel on Solaris 9> > On 11/5/07, Brian Penrose wrote:> >> >> > Hi Luis,> >> > Nope...didn't use the -P HighSecurity" parameter.> >> > Ok, that means that actually RubyGems is using SSL even you didn't> asked for it...> > I'll try to recreate the scenario later today and maybe submit a patch> for rubygems.> > You don't have alternative or don't want to install SSL?> > -- > Luis Lavena> Multimedia systems> -> Leaders are made, they are not born. They are made by hard effort,> which is the price which all of us must pay to achieve any goal that> is worthwhile.> Vince Lombardi> _______________________________________________> Mongrel-users mailing list> Mongrel-users at rubyforge.org> http://rubyforge.org/mailman/listinfo/mongrel-users Windows Live Hotmail and Microsoft Office Outlook ? together at last. Get it now! _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users _________________________________________________________________ Peek-a-boo FREE Tricks & Treats for You! http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/f06c0645/attachment.html From will at hotgazpacho.com Mon Nov 5 15:47:25 2007 From: will at hotgazpacho.com (Will Green) Date: Mon, 05 Nov 2007 15:47:25 -0500 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: Message-ID: <472F815D.8020501@hotgazpacho.com> Which Image processor are you using for attachment_fu? If you're using RMagick, it is notorious for memory leaks. Look at mini_magick or ImageScience as a replacement. == Will Green Kirk Haines wrote: > On 11/5/07, Thomas Balthazar wrote: >> Thanks for your answer. >> I'm using ruby 1.8.5 (2006-08-25) [i486-linux]. >> The Rails app uses those plugins : >> * acts_as_taggable_on_steroids >> * attachment_fu >> * exception_notification >> * localization >> >> >> Which kink of issues with my code could use that much memory? >> If I load lots of records with Active Records, aren't they "unloaded" at >> some times? > > Does your code or any of those pluginx use Array#shift? There was a > bug with Array#shift which still existed in 1.8.5 which basically left > stuff inside the array data structure after a shift, so that those > things didn't get GCd when they should have. It's a sneaky bug that > can easily eat a lot of memory. > > Otherwise, can you start a test instance of your application, and then > test it to see if there are certain actions which cause the memory > growth. That would help you pinpoint where the likely problems are. > Just use ab or httperf to send a large number of requests to specific > urls in your app, and see how ram usage changes as you do that. > > > Kirk Haines > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From matte at ruckuswireless.com Mon Nov 5 16:16:41 2007 From: matte at ruckuswireless.com (Matte Edens) Date: Mon, 05 Nov 2007 13:16:41 -0800 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: Message-ID: <472F8839.60300@ruckuswireless.com> If you're using attachment_fu and send_file then mongrel is handling the sending of files. I had the same problem, spiking memory usage, until I switched to using x_send_file. It pushes the file downloads to apache, instead of mongrel. My memory usage has never spiked since... The XSendFile plugin http://tn123.ath.cx/mod_xsendfile/ Plugin to simplify using x-sendfile... http://john.guen.in/past/2007/4/17/send_files_faster_with_xsendfile/ (e) Thomas Balthazar wrote: > On 11/5/07, *Kirk Haines* > wrote: > > On 11/5/07, Thomas Balthazar > wrote: > > > I'm running a Rails application which must sort and manipulate a > lot of data > > which are loaded in memory. > > The Rails app runs on 2 mongrel processes. > > When I first load the app, both are 32Mb in memory. > > After some days, both are between 200Mb and 300Mb. > > > > My question is : is there some kind of garbage collector in > Mongrel? > > I never see the two Mongrel processes memory footprint decrease. > > Is it normal? > > Ruby is a garbage collected language. Ruby has a conservative mark > and sweep garbage collector. > > Memory usage like that is probably not a Mongrel issue (unless you > are > generating _very_ large responses in your application). It's likely > an issue with your code. What version of Ruby are you using? Are you > using any extensions? > > > Kirk Haines > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > > > > Hello Kirk, > > Thanks for your answer. > I'm using ruby 1.8.5 (2006-08-25) [i486-linux]. > The Rails app uses those plugins : > * acts_as_taggable_on_steroids > * attachment_fu > * exception_notification > * localization > > > Which kink of issues with my code could use that much memory? > If I load lots of records with Active Records, aren't they "unloaded" > at some times? > > Thanks in advance for your help. > Thomas. > > ------------------------------------------------------------------------ > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071105/1fd6be7b/attachment.html From wyhaines at gmail.com Mon Nov 5 16:39:18 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Mon, 5 Nov 2007 14:39:18 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: <472F8839.60300@ruckuswireless.com> References: <472F8839.60300@ruckuswireless.com> Message-ID: On 11/5/07, Matte Edens wrote: > If you're using attachment_fu and send_file then mongrel is handling the > sending of files. I had the same problem, spiking memory usage, until I > switched to using x_send_file. It pushes the file downloads to apache, > instead of mongrel. My memory usage has never spiked since... This falls under the category of creating http responses. If you are using send_file within Mongrel, then the response object that is created will contain all of the file contents. If your file is small to moderately sized, that's no big deal, but if you start pushing large files around, it will have an impact on your RAM usage. Pushing huge files via send_file necessarily implies huge RAM usage. Don't do that. x_send_file is one way to avoid doing that. Kirk Haines From gwolf at gwolf.org Mon Nov 5 14:11:00 2007 From: gwolf at gwolf.org (Gunnar Wolf) Date: Mon, 5 Nov 2007 13:11:00 -0600 Subject: [Mongrel] Mongrel 1.0.2 on Ubuntu Feisty In-Reply-To: References: Message-ID: <20071105191100.GF1631@cajita.gateway.2wire.net> Andrei Maxim dijo [Sun, Oct 28, 2007 at 01:18:22AM +0200]: > Hi everybody, > > I've been trying to setup a Ruby on Rails application on a Ubuntu Feisty > machine and I've spent a lot of time trying to figure out why Nginx and > mongrel_cluster weren't working. The setup was correct (based on some > tutorials found on the internet), but there weren't any pid files for the > mongrels started. > > In case anybody else has experienced the same problem, it seems that `gem > install mongrel` will install version 1.0.2 (which is rather strange since > there isn't such a version on Rubyforge, it's either 1.0.1 or 1.0.3) which > is broken. I found a typo in configurator.rb on line 63 where instead of > target_gid it was just target_id. Forcing version 1.0.3 fixes the problem. > > However, I'm wondering why v. 1.0.2 gets installed. Any ideas? Hi, In Debian-like systems, I suggest you to install the 'mongrel' package, even if I risk starting a new flamefest in here ;-) Having different package management systems in the same OS (in this case, .deb packages and Ruby Gems) can lead to anger and pain. And, as we all know, that's just the first step down towards the Dark Side. I'm unsure whether Ubuntu Feisty includes a packaged Mongrel - I'm currently co-maintainer for Mongrel in Debian, and it's at 1.0.1 (although I plan on upgrading today/tomorrow). Greetings, -- Gunnar Wolf - gwolf at gwolf.org - (+52-55)5623-0154 / 1451-2244 PGP key 1024D/8BB527AF 2001-10-23 Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF From evan at cloudbur.st Mon Nov 5 21:50:28 2007 From: evan at cloudbur.st (Evan Weaver) Date: Mon, 5 Nov 2007 21:50:28 -0500 Subject: [Mongrel] Mongrel 1.0.2 on Ubuntu Feisty In-Reply-To: <20071105191100.GF1631@cajita.gateway.2wire.net> References: <20071105191100.GF1631@cajita.gateway.2wire.net> Message-ID: Gunnar, Come to #mongrel-dev on Freenode if you have any issues or questions. The setup.rb stuff which you probably use might be a bit shaky, because I'm not very experienced with it. Evan On Nov 5, 2007 2:11 PM, Gunnar Wolf wrote: > Andrei Maxim dijo [Sun, Oct 28, 2007 at 01:18:22AM +0200]: > > > Hi everybody, > > > > I've been trying to setup a Ruby on Rails application on a Ubuntu Feisty > > machine and I've spent a lot of time trying to figure out why Nginx and > > mongrel_cluster weren't working. The setup was correct (based on some > > tutorials found on the internet), but there weren't any pid files for the > > mongrels started. > > > > In case anybody else has experienced the same problem, it seems that `gem > > install mongrel` will install version 1.0.2 (which is rather strange since > > there isn't such a version on Rubyforge, it's either 1.0.1 or 1.0.3) which > > is broken. I found a typo in configurator.rb on line 63 where instead of > > target_gid it was just target_id. Forcing version 1.0.3 fixes the problem. > > > > However, I'm wondering why v. 1.0.2 gets installed. Any ideas? > > Hi, > > In Debian-like systems, I suggest you to install the 'mongrel' > package, even if I risk starting a new flamefest in here ;-) Having > different package management systems in the same OS (in this case, > .deb packages and Ruby Gems) can lead to anger and pain. And, as we > all know, that's just the first step down towards the Dark Side. > > I'm unsure whether Ubuntu Feisty includes a packaged Mongrel - I'm > currently co-maintainer for Mongrel in Debian, and it's at 1.0.1 > (although I plan on upgrading today/tomorrow). > > Greetings, > > -- > Gunnar Wolf - gwolf at gwolf.org - (+52-55)5623-0154 / 1451-2244 > PGP key 1024D/8BB527AF 2001-10-23 > Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Evan Weaver Cloudburst, LLC From dave at cheney.net Mon Nov 5 22:34:25 2007 From: dave at cheney.net (Dave Cheney) Date: Tue, 6 Nov 2007 14:34:25 +1100 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: <472F8839.60300@ruckuswireless.com> Message-ID: Hi Kirk, I'm wondering if we're being hit by this issue in our application. We generate a lot of thumbnails on the fly and use send_file to transfer the data back to the browsers. Checking the rails docks for send_file it indicates, that unless you use the option :stream => false, the file will be read into a 4096 byte buffer and streamed to the client. http://api.rubyonrails.com/classes/ActionController/Streaming.html#M000093 Is this a bug in send_file? Cheers Dave On 06/11/2007, at 8:39 AM, Kirk Haines wrote: > This falls under the category of creating http responses. If you are > using send_file within Mongrel, then the response object that is > created will contain all of the file contents. If your file is small > to moderately sized, that's no big deal, but if you start pushing > large files around, it will have an impact on your RAM usage. Pushing > huge files via send_file necessarily implies huge RAM usage. > > Don't do that. x_send_file is one way to avoid doing that. From pete at nextengine.com Tue Nov 6 03:11:21 2007 From: pete at nextengine.com (Pete DeLaurentis) Date: Tue, 6 Nov 2007 00:11:21 -0800 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> <3945c4270711050925m5f6fa5dao3bfc15f4d700167e@mail.gmail.com> <41E85416-EC6D-4404-A9D2-F83A5F03A124@nextengine.com> Message-ID: <8E2858EF-CC6D-4898-80BD-6D6AB5140A60@nextengine.com> Hi Kirk, Does Mongrel need to be multi-threaded at all if you're working with Rails applications? I use Lighttpd's mod_proxy_core to distribute incoming requests between 8 mongrels. If mongrel A is working on another request, I want mongrel B to pick up the request right away. If all 8 mongrels are busy, I believe Lighty retries the cycle a few times. So, who needs threads? I'm guessing this is a naive question, but I'd appreciate it if you'd set me straight. Once I get a breather in my release schedule, I plan to look at a switch to evented mongrel. Performance benchmarks + community feedback looks very good. But I still need to get a better grasp on how it works + the differences from standard mongrel. Thanks, Pete On Nov 5, 2007, at 11:02 AM, Kirk Haines wrote: > On 11/5/07, Pete DeLaurentis wrote: >> What is a good value for --num-procs for rails applications, since >> these are single threaded? Does it depend on how fast the >> application responds to users? > > It's application specific. Your sweet spot is going to be big enough > that you don't experience capacity starvation during load bursts when > you have temporary periods where more traffic is coming in than you > are clearing, but small enough that you don't waste resources. > Experimentation will probably be required to find the best balance. > > If you try evented_mongrel, you don't need to worry about num_procs. > It's irrelevant for the evented_mongrel. > > > Kirk Haines > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users From wyhaines at gmail.com Tue Nov 6 07:57:23 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Tue, 6 Nov 2007 05:57:23 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: <8E2858EF-CC6D-4898-80BD-6D6AB5140A60@nextengine.com> References: <3945c4270711050755w341bea2at5929946ea6f9b85f@mail.gmail.com> <3945c4270711050925m5f6fa5dao3bfc15f4d700167e@mail.gmail.com> <41E85416-EC6D-4404-A9D2-F83A5F03A124@nextengine.com> <8E2858EF-CC6D-4898-80BD-6D6AB5140A60@nextengine.com> Message-ID: On 11/6/07, Pete DeLaurentis wrote: > Does Mongrel need to be multi-threaded at all if you're working with > Rails applications? No. > If all 8 mongrels are busy, I believe Lighty retries the cycle a few > times. So, who needs threads? I'm guessing this is a naive > question, but I'd appreciate it if you'd set me straight. evented_mongrel still queues the request, but it does so without creating any threads, so there isn't the thread related RAM growth. > Once I get a breather in my release schedule, I plan to look at a > switch to evented mongrel. Performance benchmarks + community > feedback looks very good. But I still need to get a better grasp on > how it works + the differences from standard mongrel. My intention is that switching to evented_mongrel or swiftiplied_mongrel is transparent from the perspective of the application (or whatever is running inside a mongrel handler). Kirk Haines From hutch at recursive.ca Tue Nov 6 08:20:12 2007 From: hutch at recursive.ca (Bob Hutchison) Date: Tue, 6 Nov 2007 08:20:12 -0500 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: <20071105180510.02A331858641@rubyforge.org> Message-ID: Hi, On 5-Nov-07, at 1:38 PM, Kirk Haines wrote: > On 11/5/07, Steve Midgley wrote: > >> Thanks Kirk - I guess I'm totally OT at this point, but I hadn't >> heard >> about this bug before. From your description this is a specific >> problem >> to the underlying C code implementing shift, which is not found in >> related functions? So "array.slice!(0)" would be identical in >> function >> to shift but not contain this leak? > > Yeah. It looked to me like whoever wrote the original array.c code > just forgot something when writing the code, because it's just #shift > that has the problem. > > This bug was fixed, but not until 1.8.6. I know it is fixed as of at > least the last couple of patch releases. I am unsure if it was fixed > in the original 1.8.6 release, however. It isn't fixed in the ruby that ships with Leopard: 1.8.6 (2007-06-07 patchlevel 36) [universal-darwin9.0] This hack will fix things. class Array alias :naughty_shift :shift def shift result = self.first self[0] = nil # This is the 'magic' self.naughty_shift result end end > > > > Kirk Haines > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users ---- Bob Hutchison -- tumblelog at http://www.recursive.ca/so/ Recursive Design Inc. -- weblog at http://www.recursive.ca/hutch http://www.recursive.ca/ -- works on http://www.raconteur.info/cms-for-static-content/home/ From wyhaines at gmail.com Tue Nov 6 09:54:56 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Tue, 6 Nov 2007 07:54:56 -0700 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: <20071105180510.02A331858641@rubyforge.org> Message-ID: On 11/6/07, Bob Hutchison wrote: > It isn't fixed in the ruby that ships with Leopard: > 1.8.6 (2007-06-07 patchlevel 36) [universal-darwin9.0] Ugh. IIRC I checked it with the patch release after 36, and it was fixed there. > This hack will fix things. > > class Array > alias :naughty_shift :shift > def shift > result = self.first > self[0] = nil # This is the 'magic' > self.naughty_shift > result > end > end Note that this just _mostly_ fixes things. You still end up with array elements in memory carrying around Qnils, but most of the time that's good enough. Kirk Haines From baldmountain at gmail.com Tue Nov 6 10:05:51 2007 From: baldmountain at gmail.com (Geoffrey Clements) Date: Tue, 6 Nov 2007 10:05:51 -0500 Subject: [Mongrel] Mongrel and memory usage In-Reply-To: References: <20071105180510.02A331858641@rubyforge.org> Message-ID: <472ed2750711060705s3751dc3csbe5a8589a16a68f4@mail.gmail.com> Why not build from source: ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-darwin8.10.1] On 11/6/07, Kirk Haines wrote: > > On 11/6/07, Bob Hutchison wrote: > > > It isn't fixed in the ruby that ships with Leopard: > > 1.8.6 (2007-06-07 patchlevel 36) [universal-darwin9.0] > > Ugh. IIRC I checked it with the patch release after 36, and it was fixed > there. > > > -- geoff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071106/4f11ae7c/attachment.html From wyhaines at gmail.com Tue Nov 6 10:33:10 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Tue, 6 Nov 2007 08:33:10 -0700 Subject: [Mongrel] ANN: Swiftiply 0.6.1.1 (Mongrel > 1.0.1 compatibility) Message-ID: Just a quick announcement that an update to swiftiplied_mongrel and evented_mongrel which fixes the incompatibility with Mongrels > 1.0.1 has been released. http://swiftiply.swiftcore.org Let me know if you have any problems. Kirk Haines From david at vrensk.com Tue Nov 6 18:48:11 2007 From: david at vrensk.com (David Vrensk) Date: Wed, 7 Nov 2007 00:48:11 +0100 Subject: [Mongrel] can't configure mongrel_cluster to start on boot In-Reply-To: <84ec458f0711041531s4324dbf7v85dbb4e886612b11@mail.gmail.com> References: <84ec458f0711041531s4324dbf7v85dbb4e886612b11@mail.gmail.com> Message-ID: <81b453920711061548w534a34afo90a62501cc643bcd@mail.gmail.com> On 11/5/07, Tiberiu Motoc wrote: > > Hi everyone, > Hello Tiberiu, I'm not sure if I can solve your problem, but I hope I can shed some light on what's going on during boot time. I've been working with Mongrel, Mongrel_cluster and Apache and it is great. > However, I can't get mongrel_cluster to start at boot time. I followed the > instructions from http://mongrel.rubyforge.org/docs/mongrel_cluster.html (On > Boot Initialization Setup) and mongrel_cluster does not start after > rebooting the machine. > > I made sure that the shebang line is correct and I also made sure that the > mongrel_cluster_ctl location is in the PATH variable. Just to be on the safe > side I created a symbolic link in /usr/bin and still no luck. > When you installed the gem, you should have gotten mongrel_cluster_ctl in /usr/bin. If you didn't, you will definately need a symlink, since PATH is very limited during boot (typically "/bin:/usr/bin:/sbin:/usr/sbin"). What version of mongrel and mongrel_cluster are you using (run 'gem list mongrel')? The next thing I did was to trace the mongrel_cluster script. There is > something strange about it, and I can't believe that nobody complained about > it yet: the script takes an argument (start, stop or restart), but the > instructions provided on the mongrel_cluster webpage do not pass any > argument(s) to it. So, how is the script supposed to start? > The 'mongrel_cluster' script found in " /path/to/mongrel_cluster_gem/resources/mongrel_cluster" that the instructions tell you to copy to /etc/init.d is a normal init.d script. It can be run directly by you (as root): # /etc/init.d/mongrel_cluster stop or through the 'service' helper (still as root or sudo) $ sudo service mongrel_cluster start When you ran 'chkconfig --level 345 mongrel_cluster', chkconfig created symlinks in the directories /etc/rc0.d, /etc/rc1.d, up to /etc/rc6.d. In rc3.d, rc4.d and rc5.d there are symlinks named S85mongrel_cluster that tell the system (specifically the script '/etc/rc') to run the script with the argument 'start' (S for start) and in rc0.d etc, there is K15mongrel_cluster which the system will take as a signal to run the script with 'stop' (K for kill). So there is the magic and the reason noone has complained about the script. It is good the way it is. What about when the machine gets shut down, where in the script do we delete > the mongrel pid files? > When the machine is shut down, mongrel_cluster will be run with 'stop', and mongrel_cluster_ctl will take care of the pid files. (or worse, if it gets powered off, and if we restart without deleting the > pid files, then the script won't even start the mongrel processes). > That was a problem in and earlier release of mongrel_cluster (the gem, not the script). Now it actually peeks inside the pid files, and if it can't find the processes listed there, it will remove the pid files and proceed. As I said, this will not solve your problem, but perhaps it tells you where you should start looking. I can recommend the man pages for 'init' and 'inittab' to better understand what's going on. And everyone should read the source of /etc/rc at least once; it's short and dispels a lot of magic. Good luck, and tell us about your findings! /David -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071107/1a8a6742/attachment-0001.html From gwolf at gwolf.org Tue Nov 6 19:00:52 2007 From: gwolf at gwolf.org (Gunnar Wolf) Date: Tue, 6 Nov 2007 18:00:52 -0600 Subject: [Mongrel] Mongrel 1.0.2 on Ubuntu Feisty In-Reply-To: References: <20071105191100.GF1631@cajita.gateway.2wire.net> Message-ID: <20071107000052.GA19090@cajita.gateway.2wire.net> Evan Weaver dijo [Mon, Nov 05, 2007 at 09:50:28PM -0500]: > Gunnar, > > Come to #mongrel-dev on Freenode if you have any issues or questions. > The setup.rb stuff which you probably use might be a bit shaky, > because I'm not very experienced with it. Thanks, A bit late, as the job was far too easy in the end ;-) Congratulations for such a clean release! I reported this setup.rb bug in the tracker: http://rubyforge.org/tracker/index.php?func=detail&aid=15369&group_id=1306&atid=5145 Anyway - I have 1.0.4 ready, but it has not yet hit Debian as we just had a spectacular hardware crash in our main mirror machine :-/ I hope it will be fixed Real Soon Now (tm). Greetings, -- Gunnar Wolf - gwolf at gwolf.org - (+52-55)5623-0154 / 1451-2244 PGP key 1024D/8BB527AF 2001-10-23 Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF From ekolve at adready.com Tue Nov 6 19:50:46 2007 From: ekolve at adready.com (Eric Kolve) Date: Tue, 6 Nov 2007 16:50:46 -0800 Subject: [Mongrel] find_pid broken in mongrel_cluster 1.0.4 Message-ID: <1f068a630711061650r2dd9c8a5pbfa84780a7fd1b3@mail.gmail.com> The find_pid method no longer returns a nil by default which causes some breakage in cases where the pid can't be found since the local variable 'pid' becomes the entire output of the 'ps' command. Can you add this return back in so that it behaves the way it did earlier? thanks, eric From eden at mojiti.com Tue Nov 6 20:11:23 2007 From: eden at mojiti.com (Eden Li) Date: Tue, 6 Nov 2007 17:11:23 -0800 Subject: [Mongrel] find_pid broken in mongrel_cluster 1.0.4 In-Reply-To: <1f068a630711061650r2dd9c8a5pbfa84780a7fd1b3@mail.gmail.com> References: <1f068a630711061650r2dd9c8a5pbfa84780a7fd1b3@mail.gmail.com> Message-ID: <1dd361e10711061711u140c2945oef013a12d235aeb8@mail.gmail.com> I fixed this on my local builds by adding a `return nil` at the bottom of the function. Is there a place to put patches like this? The rubyforge page for mongrel cluster seems dead. On 11/6/07, Eric Kolve wrote: > The find_pid method no longer returns a nil by default which causes > some breakage in cases where the pid can't be found since the local > variable 'pid' becomes the entire output of the 'ps' command. Can you > add this return back in so that it behaves the way it did earlier? > > thanks, > eric > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From filipe at icewall.org Tue Nov 6 20:16:35 2007 From: filipe at icewall.org (Filipe) Date: Tue, 6 Nov 2007 23:16:35 -0200 (BRST) Subject: [Mongrel] find_pid broken in mongrel_cluster 1.0.4 In-Reply-To: <1dd361e10711061711u140c2945oef013a12d235aeb8@mail.gmail.com> References: <1f068a630711061650r2dd9c8a5pbfa84780a7fd1b3@mail.gmail.com> <1dd361e10711061711u140c2945oef013a12d235aeb8@mail.gmail.com> Message-ID: On Tue, 6 Nov 2007, Eden Li wrote: > I fixed this on my local builds by adding a `return nil` at the bottom > of the function. > > Is there a place to put patches like this? The rubyforge page for > mongrel cluster seems dead. Put this in mongrel tracker/patches page, please. Here is a direct link: http://rubyforge.org/tracker/?atid=5147&group_id=1306&func=browse Thank you guys for the report and the patch :D filipe { @ icewall.org GPG 1024D/A6BA423E Jabber lautert at jabber.ru } > > On 11/6/07, Eric Kolve wrote: >> The find_pid method no longer returns a nil by default which causes >> some breakage in cases where the pid can't be found since the local >> variable 'pid' becomes the entire output of the 'ps' command. Can you >> add this return back in so that it behaves the way it did earlier? >> >> thanks, >> eric >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users >> > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From geekmoth at gmail.com Wed Nov 7 06:36:49 2007 From: geekmoth at gmail.com (Geek Moth) Date: Wed, 7 Nov 2007 16:36:49 +0500 Subject: [Mongrel] Links go to 'localhost' Message-ID: I am using Apache2.2 + Mongrel on my machine. Now I am accessing it over LAN. When I enter http://mymachinename/myapp it opens fine but when I click on any link in my rails app, it replaces mymachinename with localhost (http://localhost/myapp/controller/action) and thus I am unable to access it from remote location. From wayneeseguin at gmail.com Wed Nov 7 07:58:09 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 7 Nov 2007 07:58:09 -0500 Subject: [Mongrel] Server timeouts In-Reply-To: References: Message-ID: On 11/2/07, Pete DeLaurentis wrote: > > Hi guys, > > Does anyone know if mongrel has a built-in timeout for requests that > take too long? If so, how do you increase it? > > I've found that some server requests are timing out. Complicated > requests are already being farmed out to asynchronous processes. But > some of the more basic requests are timing out when we have our peak > server load in the mornings (the bottleneck is the database server). > > There are a couple possible locations for the timeout I'm seeing: > > 1. Mongrel > 2. Lighttpd > 3. Client browser / application > > On my local development server, it does not timeout, leading me to > believe it's not #3. > > Any feedback is appreciated. > > Thanks, > Pete > Pete, Run the Mongrels in debugging mode and see what you can glean from this. If this is DB caused then the timeouts are more likely caused by an ORM timeout. Let us know, ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071107/5d452241/attachment.html From wayneeseguin at gmail.com Wed Nov 7 08:00:01 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 7 Nov 2007 08:00:01 -0500 Subject: [Mongrel] Mongrel Cluster: Rolling restart? In-Reply-To: <1dd361e10711022319v7414e79du1698a68576e6efa4@mail.gmail.com> References: <1dd361e10711022319v7414e79du1698a68576e6efa4@mail.gmail.com> Message-ID: On 11/3/07, Eden Li wrote: > > Hi all, > > Forgive me if this has been asked before, but is there a reason > mongrel_rails cluster::restart stops all ports and then restarts them > again? Wouldn't it be better to restart each port one-by-one in > series so that upstream proxy servers can fail over while the restart > is occurring, or am I missing something? > > Thanks, > eden Eden, You are not missing anything, this is the case. I use my own custom cluster script which does exactly this instead of mongrel_cluster. That said, patches are welcome :) Thank you, ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071107/ec05f94a/attachment.html From wayneeseguin at gmail.com Wed Nov 7 08:27:07 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 7 Nov 2007 08:27:07 -0500 Subject: [Mongrel] Links go to 'localhost' In-Reply-To: References: Message-ID: On 11/7/07, Geek Moth wrote: > > I am using Apache2.2 + Mongrel on my machine. > Now I am accessing it over LAN. When I enter http://mymachinename/myapp > it opens fine but when I click on any link in my rails app, it replaces > mymachinename with localhost (http://localhost/myapp/controller/action) > and thus I am unable to access it from remote location. Geek, It sounds to me like your apache is not passing the hostname through properly. Not enough information here for me to help more than that. Good luck, ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071107/c308c4cb/attachment.html From neongrau at gmail.com Wed Nov 7 09:01:04 2007 From: neongrau at gmail.com (gmail) Date: Wed, 7 Nov 2007 15:01:04 +0100 Subject: [Mongrel] file access with mongrel running as windows service Message-ID: