0
You need differentkinds of performance
You need differentkinds of performanceProduction
You need different kinds of performanceProductionDevelopment
Production
core 1core 2core 3core 4  …         timecore         time
core 1core 2core 3core 4  …         timecore         time
core 1core 2core 3          8core 4  …         timecore            5         time
Great max RPM == high performance?
100 ppl x 60 km/hEconomical and efficient
User cares about performance of HIS request only                   1 x 300 km/h
…especially in ruby                                               Time, s               C GNU gcc                         ...
Garbage collection (GC)core 1core 2core 3core 4  …                                       time   Actual productive work
Ideally, GC should occur between requests                  (during idle time)core 1core 2core 3core 4  …                  ...
Tweaking GC results in…            30%–50% better throughput                     AND                 response timeshttp://...
http://rpm.newrelic.com
Roundtrip to Moscow 50ms… Europe +100ms… US +100ms
In development
In developmentYou reinitialize Rails stack frequentlyYou use a single CPU core most of the time
In developmentYou reinitialize Rails stack frequently(unless using Spork etc)You use a single CPU core most of the time
In developmentYou reinitialize Rails stack frequently(unless using Spork etc)You use a single CPU core most of the time(un...
Rails’ own test suite
Rails’ own test suite~% git clone git://github.com/rails/rails.gitCloning into rails...~% cd rails~/rails[master]% git che...
MySQL 5.5        PostgreSQL 9      SQLite 3.6.16+         memcachedmysql2 gem 0.2.x (not 0.3.x)             …
~/rails[tag: v3.0.7]% cat out.txt| grep errors2294 tests, 9629 assertions, 0 failures, 0 errors419 tests, 1171 assertions,...
~/rails[tag: v3.0.7]% cat out2.txt | ruby -ne next unless$_ =~ /^((d+) (tests|assertions|failures|errors)(?:, )?){4}$/; $_...
## ruby -ne ...next unless $_ =~ /^((d+) (tests|assertions|failures|errors)(?:, )?){4}$/$_.split(", ").each do |pair|  cou...
CC (attribution) photosbus http://www.flickr.com/photos/futurepastnow/2972823328ferrari http://www.flickr.com/photos/dontthi...
Rails Hardware (no conclusions!)
Rails Hardware (no conclusions!)
Rails Hardware (no conclusions!)
Upcoming SlideShare
Loading in...5
×

Rails Hardware (no conclusions!)

214

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
214
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • simplest of all, but it does not tell the whole story\n
  • This is where cloud infrastructure may seem inferior.\n
  • \n
  • you should benchmark representative code to be relevant, not calculating Pi\n
  • \n
  • (and less frequently too)\n
  • What’s the word on tweaking GC in ruby 1.9?\n
  • free + lots of promo codes\nyou want to track queueing time as well \nUse REE to get GC info\nOutlier requests analysis is not so useful, to me it always happens during the times of I/O shortage, not CPU shortage\nAn opportunity to create a more focused service\nRecall cloud hosting\n\nIn real application, there may be no single point responsible for the slowdown\n"Death by a thousand cuts" is the toughest one to combat\nExcept we can jump to the latests CPUs\nTurbo boost, eh? Perhaps underutilized Xeons are the way to go to get the absolute max\nA particular problem with Rails 3 where middleware is slightly slower, activerecord is slightly slower, who knows what else slightly slower\nThis is what the adoption rate slow\nView helpers are slow when there are many of them\nSerialization is slow\nHappens when loading structured data from memcached\nLoad strings?\n
  • \n
  • Why Basecamp feels sluggish\nWhy Rails 3 is adopted slowly\nWhy streaming in Rails 3.1 may change the game\n
  • \n
  • Chances are, you will be loading a single core\nYou need fastest startup time - running rake tasks, tests, generators, console, restarting the server\nThe way rubygems are written, every 'require' inspects LOADPATH\nRuby 1.9.2 is not that good for fast startups\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "Rails Hardware (no conclusions!)"

    1. 1. You need differentkinds of performance
    2. 2. You need differentkinds of performanceProduction
    3. 3. You need different kinds of performanceProductionDevelopment
    4. 4. Production
    5. 5. core 1core 2core 3core 4 … timecore time
    6. 6. core 1core 2core 3core 4 … timecore time
    7. 7. core 1core 2core 3 8core 4 … timecore 5 time
    8. 8. Great max RPM == high performance?
    9. 9. 100 ppl x 60 km/hEconomical and efficient
    10. 10. User cares about performance of HIS request only 1 x 300 km/h
    11. 11. …especially in ruby Time, s C GNU gcc 1.07 Java 6 -server 1.55 Haskell GHC 2.16 Scala 2.22 Lisp SBCL 2.67 C# Mono 2.95 OCaml 3.35 Clojure 5.32 Erlang HiPE 13.17 Python 3 28.07 Ruby 1.9 65.14by http://shootout.alioth.debian.org Computer Language Benchmarks Game  
    12. 12. Garbage collection (GC)core 1core 2core 3core 4 … time Actual productive work
    13. 13. Ideally, GC should occur between requests (during idle time)core 1core 2core 3core 4 … time what USER cares about
    14. 14. Tweaking GC results in… 30%–50% better throughput AND response timeshttp://www.rubyenterpriseedition.com/documentation.html#_garbage_collector_performance_tuning
    15. 15. http://rpm.newrelic.com
    16. 16. Roundtrip to Moscow 50ms… Europe +100ms… US +100ms
    17. 17. In development
    18. 18. In developmentYou reinitialize Rails stack frequentlyYou use a single CPU core most of the time
    19. 19. In developmentYou reinitialize Rails stack frequently(unless using Spork etc)You use a single CPU core most of the time
    20. 20. In developmentYou reinitialize Rails stack frequently(unless using Spork etc)You use a single CPU core most of the time(unless using parallel_specs, hydra etc)
    21. 21. Rails’ own test suite
    22. 22. Rails’ own test suite~% git clone git://github.com/rails/rails.gitCloning into rails...~% cd rails~/rails[master]% git checkout v3.0.7Note: checking out v3.0.7.…HEAD is now at 2c32601... bumping version for release~/tmp/rails[tag: v3.0.7]% bundle installFetching source index for http://rubygems.org/…Your bundle is complete! Use `bundle show [gemname]` to see where abundled gem is installed.~/tmp/rails[tag: v3.0.7]% time bundle exec rake test | tee out.txt 2>&1
    23. 23. MySQL 5.5 PostgreSQL 9 SQLite 3.6.16+ memcachedmysql2 gem 0.2.x (not 0.3.x) …
    24. 24. ~/rails[tag: v3.0.7]% cat out.txt| grep errors2294 tests, 9629 assertions, 0 failures, 0 errors419 tests, 1171 assertions, 0 failures, 0 errors2981 tests, 12075 assertions, 0 failures, 0 errors72 tests, 142 assertions, 0 failures, 0 errors200 tests, 515 assertions, 0 failures, 0 errors273 tests, 773 assertions, 0 failures, 0 errors2483 tests, 7646 assertions, 0 failures, 0 errors2471 tests, 7634 assertions, 0 failures, 0 errors2443 tests, 7555 assertions, 0 failures, 0 errors2522 tests, 7865 assertions, 0 failures, 0 errors28 tests, 33 assertions, 0 failures, 0 errors6 tests, 15 assertions, 0 failures, 0 errors7 tests, 14 assertions, 0 failures, 0 errors1 tests, 0 assertions, 0 failures, 0 errors1 tests, 1 assertions, 0 failures, 0 errors10 tests, 12 assertions, 0 failures, 0 errors6 tests, 7 assertions, 0 failures, 0 errors13 tests, 18 assertions, 0 failures, 0 errors5 tests, 9 assertions, 0 failures, 0 errors1 tests, 2 assertions, 0 failures, 0 errors3 tests, 6 assertions, 0 failures, 0 errors21 tests, 22 assertions, 0 failures, 0 errors4 tests, 28 assertions, 0 failures, 0 errors5 tests, 7 assertions, 0 failures, 0 errors4 tests, 4 assertions, 0 failures, 0 errors13 tests, 18 assertions, 0 failures, 0 errors5 tests, 5 assertions, 0 failures, 0 errors3 tests, 3 assertions, 0 failures, 0 errors1 tests, 1 assertions, 0 failures, 0 errors4 tests, 4 assertions, 0 failures, 0 errors37 tests, 69 assertions, 0 failures, 0 errors35 tests, 305 assertions, 0 failures, 0 errors … (continues)
    25. 25. ~/rails[tag: v3.0.7]% cat out2.txt | ruby -ne next unless$_ =~ /^((d+) (tests|assertions|failures|errors)(?:, )?){4}$/; $_.split(", ").each { |pair| count, name =*pair.split(" "); @totals ||= {}; @totals[name] ||= 0;@totals[name] += count.to_i }; print "r"+@totals.map { |key, val| "#{key} #{val}"}.join(", "); STDOUT.flush; END{puts}failures 0, tests 16658, errors 0, assertions 56316
    26. 26. ## ruby -ne ...next unless $_ =~ /^((d+) (tests|assertions|failures|errors)(?:, )?){4}$/$_.split(", ").each do |pair| count, name = *pair.split(" ") @totals ||= {} @totals[name] ||= 0 @totals[name] += count.to_iendprint "r"+@totals.map { |key, val| "#{key} #{val}"}.join(", "); STDOUT.flush;END {puts}
    27. 27. CC (attribution) photosbus http://www.flickr.com/photos/futurepastnow/2972823328ferrari http://www.flickr.com/photos/dontthinkfeel/200793214/obie http://www.flickr.com/photos/seanosh/2544491971earth NASArope walking http://www.flickr.com/photos/envizion/470658414
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×