From: James Britt Date: 2004-11-21T00:28:58+09:00 Subject: Re: mission critical Ruby? David Heinemeier Hansson wrote: >> How does Rails do on speed? I recall a thread here some months ago on >> this, with doubts on Rails response time. > > > This thread came about from a guy that had misconfigured his setup and > where using CGI. It never represented the reality of performance with > Rails. > >> I've been trying out a small app using Rails, and I'm struck by how >> long to takes to do trivial searches (basically, my app is essentially >> the Friends/Phones example in the rubyonrails.org site tutorial). > > > Look in your logs: tail -f log/production.log. It's very easy to spot > where your bottleneck. Perhaps it's a bad SQL query operating on a table > with two many rows and no indexes. 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. I created my app by following the tutorial, then going back and changing table and field names. http://www.rubyonrails.org/show/TutorialStepOne I've been testing things with about two rows of data in each indexed table. > > 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. Thanks, James