[Mongrel] memory issues -- mongrel part of the problem?
jan.svitok at gmail.com
Tue Nov 14 19:24:29 EST 2006
On 11/14/06, Clint Troxel <clint at ctro.net> wrote:
> Hi. I'm a fairly new mongrel user and have a scenario that I wanted
> to run by you all, see if anyone's synapses connect -- mine def.
> I'm running a fairly simple rails app through a mongrel cluster (2
> mongrels). This site is consistently sloooow -- memory on the server
> is regularly paging (and shouldn't be). ssh-ing in and running top
> shows these two mongrel processes taking up about 80% of the 1 gig of
> system memory.
> the only interesting thing the application is doing is storing photos
> in the database and resizing the photos on the way out using
> mini_magick. Once the photos are delivered once they are cached using
> rails page caching (i'm positive the caching is working,
> production.log says so).
> So, at this point the site should only be delivering images from the
> cache (which is currently on disk) apache isn't serving the images,
> mongrel is. -- but, things are slow. Does this ring any bells for
> you can check the site out (don't pound too hard please! ;) )
> click on the "developments" tab to see what i mean -- those thumbnail
> images are coming from the cache.
> Server : Fedora Core 5
> Mongrel: 0.3.13.3
> mongrel_cluster: 0.2.0
> I'm eternally grateful to anyone who can help me out with this! Sort
> of at the end of my rope.
> Thanks in advance, & hope your Tuesday is good.
from what I've heard, it's better to have apache serve the files -
it's faster and doesn't interfere with ruby's garbage collector.
Then, I'd suspect the resizing eats the memory and slows down. To know the
precise number, try profiling it, both outside and inside mongrel and rails.
Look for some forgotten reference to the image. Also look for the
trends - whether memory consumption grows (you have a leak or hanging
reference somewhere) or oscillates.
More information about the Mongrel-users