[Mongrel] Mongrel and memory usage

Matte Edens matte at ruckuswireless.com
Mon Nov 5 16:16:41 EST 2007


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* <wyhaines at gmail.com 
> <mailto:wyhaines at gmail.com>> wrote:
>
>     On 11/5/07, Thomas Balthazar <thomas.tmp at gmail.com
>     <mailto:thomas.tmp at gmail.com>> 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 <mailto:Mongrel-users at rubyforge.org>
>     http://rubyforge.org/mailman/listinfo/mongrel-users
>     <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 


More information about the Mongrel-users mailing list