[Mongrel] RMagick=bad, ???=good
I know that Zed has made mention of the fact that using RMagick with mongrel and rails is a bad thing. I'm currently using FlexImage (which in turn uses RMagick) on my application and really haven't had too many problems. We get a restart for memory usage every 8-10 hours on one mongrel of twelve running, but I'm not sure if that's an RMagick issue. Either way, I'd like to make my system better if I can. Right now I've got controllers that are using both send_data (sending image stored in the db, using RMagick to crop/resize before sending) and send_file (sending a static image on the site that needs to be sent inline). Image upload is being handled by FlexImage, which will save the image to the DB, resizing it to 640x480 before saving if it's too big. My question is, what then is the preferred method of doing image manipulation while running mongrel? Convert FlexImage to use mini-magick? Create a custom system to offload the image processing to another process? If someone can provide some insight or examples, it would be appreciated. ___ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users
Re: [Mongrel] RMagick=bad, ???=good
On Fri, 15 Dec 2006 11:14:20 -0600 Joey Geiger [EMAIL PROTECTED] wrote: I know that Zed has made mention of the fact that using RMagick with mongrel and rails is a bad thing. I'm currently using FlexImage (which in turn uses RMagick) on my application and really haven't had too many problems. We get a restart for memory usage every 8-10 hours on one mongrel of twelve running, but I'm not sure if that's an RMagick issue. Either way, I'd like to make my system better if I can. Right now I've got controllers that are using both send_data (sending image stored in the db, using RMagick to crop/resize before sending) and send_file (sending a static image on the site that needs to be sent inline). Image upload is being handled by FlexImage, which will save the image to the DB, resizing it to 640x480 before saving if it's too big. My question is, what then is the preferred method of doing image manipulation while running mongrel? Convert FlexImage to use mini-magick? Create a custom system to offload the image processing to another process? If someone can provide some insight or examples, it would be I work on a shall not be named here large Web site devoted to handling large numbers of photographic imagery. Although our site is not running in Ruby, yet, we have worked through a number of approaches to handling this, but only one has the desired properties we need, which is automatic recovery and minimal impact to running code on failure: exec out another process to do image manipulation. If you're doing something small, feel free to use RMagick+death+recovery if you want, but exec-ing out really is the way to go. Jim signature.asc Description: PGP signature ___ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users
Re: [Mongrel] RMagick=bad, ???=good
Just to chime in - we are using RMagick with Gruff on mongrel/apache combo without any memory leaks or restart problems. Our cluster happily runs for weeks at a time, before we restart it (usual because of new code released). I am also curious to know what specific problems are reported related to RMagick. Thanks Konstantin On Dec 15, 2006, at 9:14 AM, Joey Geiger wrote: I know that Zed has made mention of the fact that using RMagick with mongrel and rails is a bad thing. I'm currently using FlexImage (which in turn uses RMagick) on my application and really haven't had too many problems. We get a restart for memory usage every 8-10 hours on one mongrel of twelve running, but I'm not sure if that's an RMagick issue. Either way, I'd like to make my system better if I can. Right now I've got controllers that are using both send_data (sending image stored in the db, using RMagick to crop/resize before sending) and send_file (sending a static image on the site that needs to be sent inline). Image upload is being handled by FlexImage, which will save the image to the DB, resizing it to 640x480 before saving if it's too big. My question is, what then is the preferred method of doing image manipulation while running mongrel? Convert FlexImage to use mini-magick? Create a custom system to offload the image processing to another process? If someone can provide some insight or examples, it would be appreciated. ___ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users ___ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users
Re: [Mongrel] RMagick=bad, ???=good
Although our site is not running in Ruby, yet, we have worked through a number of approaches to handling this, but only one has the desired properties we need, which is automatic recovery and minimal impact to running code on failure: exec out another process to do image manipulation. I must admit that we do the same thing at 37signals. But actually not because of memory leaks, but because we found it easier to do: def thumbnail(temp, target) system convert #{escape(temp)} -resize 48x48! #{escape(target)} end Rather than to get the full RMagick machinery cooking. -- David Heinemeier Hansson http://www.37signals.com-- Basecamp, Campfire, Backpack, Getting Real http://www.rubyonrails.com -- Web-application framework http://www.loudthinking.com -- Broadcasting Brain smime.p7s Description: S/MIME cryptographic signature ___ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users
Re: [Mongrel] RMagick=bad, ???=good
On 12/15/06, David Heinemeier Hansson [EMAIL PROTECTED] wrote: Although our site is not running in Ruby, yet, we have worked through a number of approaches to handling this, but only one has the desired properties we need, which is automatic recovery and minimal impact to running code on failure: exec out another process to do image manipulation. I must admit that we do the same thing at 37signals. But actually not because of memory leaks, but because we found it easier to do: def thumbnail(temp, target) system convert #{escape(temp)} -resize 48x48! #{escape(target)} end Rather than to get the full RMagick machinery cooking. There's also minimagick, which is a shell around imagemagick commands. Probably easier if you want to do more complex operations on your images. Oh, and ImageScience, which uses FreeImage and a light inline ruby wrapper. http://seattlerb.rubyforge.org/ImageScience.html -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com ___ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users
Re: [Mongrel] RMagick=bad, ???=good
I know that Zed has made mention of the fact that using RMagick with mongrel and rails is a bad thing. I'm currently using FlexImage (which in turn uses RMagick) on my application and really haven't had too many problems. We get a restart for memory usage every 8-10 hours on one mongrel of twelve running, but I'm not sure if that's an RMagick issue. Either way, I'd like to make my system better if I can. Right now I've got controllers that are using both send_data (sending image stored in the db, using RMagick to crop/resize before sending) and send_file (sending a static image on the site that needs to be sent inline). Image upload is being handled by FlexImage, which will save the image to the DB, resizing it to 640x480 before saving if it's too big. My question is, what then is the preferred method of doing image manipulation while running mongrel? Convert FlexImage to use mini-magick? Create a custom system to offload the image processing to another process? If someone can provide some insight or examples, it would be appreciated. Just to add to what others have said there is also the GD2 library and if you're willing to shell out, netpbm. Although I would imagine GD2 has the same potential for memory leaks as ImageMagick if I understand the issue correctly (that is ruby not knowing about memory allocated by the extension). We use rmagick now, but don't upload that many images (admin interface only). My last job (not Rails, but that doesn't matter) we shelled out to netpbm for a couple of reasons -- we were dealing with a lot of arcane formats (PCX with specific header formats) and because I'd run some tests converting/scaling images using GD, ImageMagick, and netpbm and netpbm seemed to do the best job and delivery the smallest file. Now... that was about six years ago so things may certainly have changed. -philip ___ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users