This post originated from an RSS feed registered with Ruby Buzz
by Obie Fernandez.
Original Post: Expensive operations especially dangerous in Rails
Feed Title: Obie On Rails (Has It Been 9 Years Already?)
Feed URL: http://jroller.com/obie/feed/entries/rss
Feed Description: Obie Fernandez talks about life as a technologist, mostly as ramblings about software development and consulting. Nowadays it's pretty much all about Ruby and Ruby on Rails.
You know how some web application servers interrupt processing on the server side when the browser's stop button is pressed? Yeah? Well, unfortunately you don't get that behavior with Rails (Not on Mongrel or Webrick, anyway. FastCGI anyone?). The practical implication is that if a user hits an action in your app that takes forever to execute and subsequently hits the stop button (or otherwise ends the request prematurely) you are now minus one Rails process on your server until execution finishes. If the frustrated user proceeds to click again and again, congratulations on giving him the ability to inadvertently DOS your application.
In case you're wondering, I noticed this a little while ago because one of the screens in my current project application has no pagination yet -- I navigated to it, got impatient and moved on to something else. Exactly 279 seconds later (while not touching the browser or console) I noticed activity in my tailed development.log. "WTF? Oh... Crap."
Zed sez that it's widespread knowledge, but I don't think so.
Tired of your job? Need to hire developers? Visit DZone Jobs: great people, great opportunities.