From: David Heinemeier Hansson Date: 2004-11-21T07:14:06+09:00 Subject: Re: mission critical Ruby? > Well, I'm not writing any SQL, Rails is. Really; my app is the > Friends/Phone tutorial. Different table and field names, but almost > exactly the same number of tables and fields and simple relationship. > One main table, where each record may refer to zero or more rows in a > secondary tale, related by a single-column foreign key. It's about > the simplest relational model there is. The friends/phone tutorial is a work-in-progress by people trying to learn Rails. It's not a best practice implementation, so use it for inspiration on how to get started, but not as a definite guide. An even though Rails is writing the SQL, it's doing so according to the methods you call. That's why it's a good idea to have an eye on the production.log, so you get an early warning if you're using the API in a way that'll lead to performance bottlenecks. >> But as long as you're just on CGI or WEBrick with cached classes >> turned off, be prepared that getting 1 req/sec is par for course on a >> reasonable modern machine. On old crusty hardware, it'll be even >> worse. > > I switched from CGI to WEBrick, and the speed issue may be the lack of > class caching, so I'll give that a whirl, then set up some benchmark > tests. It's certain that the speed issue is due to lack of class caching. When not turned on, WEBrick will start a new Ruby interpreter for every request. Which causes you to incur the full start-up cost every time. Just like regular CGI. -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://macromates.com/ -- TextMate: Code and markup editor (OS X) http://www.loudthinking.com/ -- Broadcasting Brain