Successfully reported this slideshow.
Your SlideShare is downloading. ×

Performance - When, What and How

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Rails Performance
    When, What and How




                  Vitaly Kushner
                    @vkushner

YouTube videos are no longer supported on SlideShare

View original on YouTube

Vitaly Kushner
programming since middle 80s
 professionally since early 90s
       Rails since 2005
   founded Astrails in...
Upcoming SlideShare
Cvcc performance tuning
Cvcc performance tuning
Loading in …3
×

Check these out next

1 of 45 Ad

Performance - When, What and How

Download to read offline

Our presentation on Israel Rails Conference 2012. Vitaly talking about rails performance, how to measure, what to improve and just as much important - what not to improve

Our presentation on Israel Rails Conference 2012. Vitaly talking about rails performance, how to measure, what to improve and just as much important - what not to improve

Advertisement
Advertisement

More Related Content

Slideshows for you (20)

Advertisement

Similar to Performance - When, What and How (20)

Advertisement

Recently uploaded (20)

Performance - When, What and How

  1. 1. Rails Performance When, What and How Vitaly Kushner @vkushner
  2. 2. Vitaly Kushner programming since middle 80s professionally since early 90s Rails since 2005 founded Astrails in 2008
  3. 3. http://astrails.com/blog
  4. 4. performance
  5. 5. slow for whatever reason
  6. 6. performance
  7. 7. performance • raw speed • throughput • scalability • end-user
  8. 8. No time to dive into details
  9. 9. When to optimize? and when not to.
  10. 10. what to do with 1M users
  11. 11. Celebrate! you’ve made it.
  12. 12. why startups fail?
  13. 13. NOT because of performance problems
  14. 14. 1 million users
  15. 15. first 1000 users!
  16. 16. have scalability problem?
  17. 17. GREAT! because it means you grow fast
  18. 18. later
  19. 19. Scalability Plan • understand the limits • know your next step
  20. 20. performance does it matter?
  21. 21. YES! performance is very important
  22. 22. Is 1% a lot? yes, if you are Google.
  23. 23. Why not to optimize anyway?
  24. 24. time and budget usually limited
  25. 25. Measure You can not improve what you do not measure.
  26. 26. Tools • Yahoo Yslow http://developer.yahoo.com/yslow/ • Google PageSpeed https://developers.google.com/speed/pagespeed • NewRelic - http://newrelic.com • httperf & ab • Blitz.io
  27. 27. limit number of records from the database
  28. 28. oink https://github.com/noahd1/oink
  29. 29. Instantiation Breakdown: Total: 14 | User: 4 | Experience: 3 | Location: 3 | Interest: 3 | Admin: 1
  30. 30. limit number of queries prevent 1+N queries problem
  31. 31. bullet https://github.com/flyerhzm/bullet
  32. 32. N+1 Query detected Experience => [:interest] Add to your finder: :include => [:interest]
  33. 33. define indexes can be done later
  34. 34. query_reviewer https://github.com/nesquena/query_reviewer
  35. 35. limit number of http requests consolidate assets assets pipeline makes it easy
  36. 36. css at the top js at the bottom improves perceived page speed
  37. 37. low level hacks • replace :include with :join • explicit :select
  38. 38. not recommened
  39. 39. Maintainability usually better then speed
  40. 40. low hanging fruits • compress and http cache assets • CDN libraries • image sprites • bundle images into CSS • CDN for all static assets
  41. 41. Caching much later
  42. 42. real performance problem?
  43. 43. next time...
  44. 44. Thank you! Slides and video will be published at http://astrails.com/blog Vitaly Kushner @vkushner

×