I've had a right fun few days at work trying to figure out why our Rails app (which isn't under very heavy load) kept eating memory and bringing our server to our knees. Eventually I traced it to send_file (which was in a way a relief as it wasn't down to my coding ;) -- every time a user started downloading, the memory consumed by the app would jump, and wouldn't go down again, even when they had cancelled the download (I haven't tested whether the memory would still be consumed after they completed the download). This has become apparent recently as the app has been used for larger files (150MB and upwards). As a fix I've delegated file serving to lighttpd + mod_sec_download, not quite as convenient but probably better in the long run anyway.
So the problem is solved, but I was just wondering why this happened in the first place; according to the Rails docs, send_file buffers the response in order to not tie up memory. However, this was clearly not happening -- is this possibly related to how Mongrel interacts with Rails? If so, I gave it a try under lighttpd and still had the problem, any idea why? I'm really just looking to understand the issue better as I hate to walk away from a problem without fully comprehending it :) Thanks, -- Jonathan Leighton, Web Developer Portfolio: http://jonathanleighton.com/ Personal: http://turnipspatch.com/ _______________________________________________ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users