On Mon, Mar 24, 2008 at 3:58 PM, Scott Windsor <[EMAIL PROTECTED]> wrote: > > Right now my current deployment configuration for all my rails applications > is using apache + fastcgi. > > With this deployment strategy, if I don't set the garbage collection in my > dispatch.fcgi, any rails application I use that uses image magick (for > resizing/effects/etc) eats memory like a hog. > In my dispatch... > http://dev.rubyonrails.org/browser/trunk/railties/dispatches/dispatch.fcgi > I usually set this to around 50 executions per gc run and my rails apps seem > pretty happy. >
You're using *RMagick*, not ImageMagick directly. If you used the later (via system calls) there will no be memory leakage you can worry about. > This has been working great for me thus far, but using mod_fastcgi leaves > zombies processes occasionally during restart. Checking in with the docs, > mod_fastcgi is more or less deprecated, and mod_fcgid is prefered. > mod_fcgid has all sorts of issues (random 500s and the like), and to boot > the documentation is quite poor. > Moving from FastCGi to Mongrel will also require you monitor your cluster processes with external tools, since you're suing things that leak too much memory like RMagick and requires restart of the process. To make it clear: the memory leaked by RMagick cannot be recovered with garbage collection mechanism. I tried that several times but in the long run, required to restart and hunt down all the zombies processes left by Apache. > So, I've decieded to move my apps over to using nginx with proxy with > mongrel. The decsion to move the nginx is pretty minor (it's lighter weight > and easier to configure), but my decision to move to mongrel warrented a bit > of research. I do want to ensure that all of my applications behave > properly in terms of memory consumption and the first thing I've noticed is > that mongrel doesn't have the same options available for customizing when > the GC runs. > Can you tell me how you addressed the "schedule" of the garbage collection execution on your previous scenario? AFAIK most of the frameworks or servers don't impose to the user how often GC should be performed. > This leads me to believe that either there's something specific to rails > running under FastCGI that requires the GC to disabled/enabled during > processes execution or mongrel hasn't implemented the feature yet. > I'll bet is rails specific, or you should take a look at the fcgi ruby extension, since it is responsible, ruby-side, of bridging both worlds. On a personal note, I believe is not responsibility of Mongrel, as a webserver, take care of the garbage collection and leakage issues of the Vm on which your application runs. In any case, the GC of the VM (MRI Ruby) should be enhanced to work better with heavy load and long running environments. -- Luis Lavena Multimedia systems - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams _______________________________________________ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users