This project is archived and is in readonly mode.
Rails 3 AR performance has regressed since Rails 2
-
Sam Saffron
- Tag set to active_record, performance, rails3
-
drjoke
Has there been any update to your issue? I am using Rails 3.0 Beta 4 and am finding it is much slower than Rails 2.3.5
I am using Ruby Enterprise 1.8.7 and Passenger 2.2.15
I go from 5.31 trans/sec to 3.05 trans/sec per AWS EC2 instance.
$ siege -c 5 -t 1M http://localhost RAILS 2.3.5 RESULTS Transactions: 320 hits Availability: 100.00 % Elapsed time: 60.26 secs Data transferred: 6.76 MB Response time: 0.45 secs Transaction rate: 5.31 trans/sec Throughput: 0.11 MB/sec Concurrency: 2.41 Successful transactions: 320 Failed transactions: 0 Longest transaction: 1.05 Shortest transaction: 0.25 RAILS 3 Transactions: 169 hits Availability: 100.00 % Elapsed time: 55.38 secs Data transferred: 3.72 MB Response time: 1.06 secs Transaction rate: 3.05 trans/sec Throughput: 0.07 MB/sec Concurrency: 3.23 Successful transactions: 169 Failed transactions: 0 Longest transaction: 1.74 Shortest transaction: 0.58 -
Miles Egan
Tried this on a slightly more formal benchmark, with a test script like this:
10.times do 1000.times{ Post.create(:title => "bla", :body => "x" * 1000) } max = Post.maximum(:id) 1000.times{ Post.find(rand(max) + 1) } endInvoked like this:
[21:14:57] miles slopper ~/c/perftest2 $ rake db:drop; rake db:create; rake db:migrate; time ./script/runner -e production ~/tmp/posttest ... real 2m12.275s user 0m41.200s sys 0m1.640sand this:
$ rake db:drop; rake db:create; rake db:migrate; time ~/c/rails/bin/rails runner -e production ~/tmp/posttest ... real 3m21.563s user 1m8.380s sys 0m1.920sThis is with a postgres database on a Ubuntu 10.04 machine. So I'm seeing a similar slowdown. Of course, benchmarking is a notoriously tricky business so it's hard to be sure to what extent this reflects a real-world workload.
-
Aaron Patterson
- Assigned user set to Aaron Patterson
- Importance changed from to Low
I'll take a look in to this.
-
drjoke
This ticket should be merged into this:
https://rails.lighthouseapp.com/projects/8994/tickets/5098-rails-3-...
I don't know how to do it, but the same problem is better identified there.