[Mongrel] Memory leaks in my site

Carl Lerche carl.lerche at gmail.com
Wed Mar 7 23:49:07 EST 2007


I'm going to go ahead and blame acts_as_ferret. I had an application
that used acts_as_ferret and each mongrel process reached up to 300MB.
I removed acts_as_ferret (as well as switched from mysql to
postgresql) and now the exact same application is staying steady at 70
MB a process. I also use a lot of RMagick in that same application
(didn't have time to remove it) but the processes still stay at 70MB.

Hope this helps.

On 3/6/07, Joey Geiger <jgeiger at gmail.com> wrote:
> Here are the plugins that were on the application when I just tried
> loading a single controller, which ended up hitting an 80MB limit
> after about 8 hours on all 4 mongrels running rails 1.2.2. They all
> restarted within minutes of each other, which was interesting.
>
> acts_as_ferret
> arts
> authorization
> custom-err-msg
> exception_notification
> flex_image
> has_many_polymorphs
> http_url_validation
> paginating_find
> rails_rcov
> resource_feeder (added after test)
> restful_authentication
> routing_navigator
> simply_helpful
> sql_session_store
> timed_fragment_cache
>
> The application I have in development that restarts every few days has
> the following plugins.
> acts_as_authenticated
> acts_as_rateable
> arts
> assert_select
> authorization
> browser_filters
> custom-err-msg
> debug_view_helper
> exception_notification
> flex_image
> paginating_find
> rails_rcov
> responsible_markup
> simple_http_auth
> timed_fragment_cache
> white_list
>
> I ran the tests with and without GC.start in the controller.
> GC.start kicked off in the production application when I do a send_data call.
>
>
>
>
> On 3/6/07, Carl Lerche <carl.lerche at gmail.com> wrote:
> > Did you try adding GC.start in your application?
> >
> > On 3/6/07, Joey Geiger <jgeiger at gmail.com> wrote:
> > > I've got issues with my rails application leaking memory as well. I
> > > can say it's not Mongrel's fault, as I was able to duplicate the
> > > situation in Webbrick.
> > >
> > > My problem happens because I'm using monit to make sure my site stays
> > > up, but in doing so, monit hits each of my mongrels every minute. I
> > > thought the memory issues had to do with images, send_data or
> > > something else, and what I found, is that on a site that does nothing
> > > but respond to this monit controller, the memory grew and grew.
> > >
> > > I'm guessing it has to do with the plugins I'm using, as when I tried
> > > the same thing on a fresh rails application, the memory grew, but
> > > capped off at about 35MB, where the full application loading all
> > > plugins continued to grow until I killed it, never recovering memory.
> > >
> > > So, for now, monit is the cause and solution to my memory problems. I
> > > was thinking about trying to create a handler for mongrel that monit
> > > can hit to verify that it's running, but then there's the possibility
> > > that mongrel is up, but my application is down.
> > >
> > > My other issue with using monit are the constant hits to the log
> > > files, which logger.silence doesn't help (at least the methods I've
> > > tried) If someone knows how to silence a controller completely, I'd
> > > love to know.
> > >
> > > Right now I'm a bit busy, but I think it would be a good test to add
> > > my plugins one at a time to a fresh application and check the memory
> > > usage after hitting it with a few thousand hits from apache bench.
> > >
> > >
> > > On 3/6/07, Ken Wei <2828628 at gmail.com> wrote:
> > > > 'gem cleanup' i did that, but still
> > > >
> > > > _______________________________________________
> > > > 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
> > >
> >
> >
> > --
> > EPA Rating: 3000 Lines of Code / Gallon (of coffee)
> > _______________________________________________
> > 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
>


-- 
EPA Rating: 3000 Lines of Code / Gallon (of coffee)


More information about the Mongrel-users mailing list