Scalingprezo

208 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
208
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Scalingprezo

  1. 1. Fail Whale
  2. 2. Scaling & RailsYou scale a website, not a framework
  3. 3. Scaling SOPsGeneral Things Standard Operating Procedures for website scaling
  4. 4. OODA Loop
  5. 5. OODA Loop
  6. 6. Observe New RelicClient (customers) needs User needs
  7. 7. Rumsfeld
  8. 8. Rumsfeld Known knowns Known unknownsUnknown unknowns
  9. 9. Observe: Known knowns:What do we know that we know about clients?
  10. 10. Observe: Known unknownsDo we know that we know at least afew pages users are likely to hit often?
  11. 11. Observe: Known unknownsWe know users will use some features more than others.We dont know which ones they will be.
  12. 12. Observe: Known unknownsWe know which devices they will be consuming the site with.We dont know the percentages for sure.
  13. 13. Observe: Unknown unknownsWhat assumptions do we bring, and which of them may be wrong?
  14. 14. OrientFocus on the known knowns
  15. 15. OrientWe know the strategies:
  16. 16. Orient Page CachingFragment Caching Action CachingDatabase Caching
  17. 17. Decide Por ejemplo:To cache the landing page, or articles, or products Or All of the above
  18. 18. Actclass ProductsController < ApplicationController caches_page :index, :show def index @products = Product.page(params[:page]).per_page(10) end def show @product = Product.find(params[:id]) end # Other actions omitted.end
  19. 19. Actclass ProductSweeper < ActionController::Caching::Sweeper observe Product def after_update(product) expire_page products_path expire_page product_path(product) expire_page "/" FileUtils.rm_fr "#{page_cache_directory}/products/page" endend
  20. 20. Iterate
  21. 21. ObserveWhat do we learn from Httperf + Browsermob + Apache Bench + user feedback?
  22. 22. ObserveWhat have we learned about our SOPs?
  23. 23. ObserveWhich known unknowns have become Known knowns?
  24. 24. ObserveWhich Unknown unknowns have become Known unknowns?
  25. 25. OrientWhich techniques can be used to solve the known knowns?
  26. 26. Iterate
  27. 27. Mise en place
  28. 28. [Miz on plas] Mise en place (pronounced [miz on plas],literally "putting in place") is a French phrase defined by the Culinary Institute of America as "everything in place", as in set up. It is used in professional kitchens to refer to organizing and arranging the ingredients (e.g., cuts of meat, relishes, sauces, par-cooked items, spices, freshly chopped vegetables, and other components) that a cook will require for the menu items that he or she expects to prepare during his/her shift.[1]
  29. 29. GT mise en placeWhat might our developer kitchen look like? Our staging kitchen? Our production kitchen?
  30. 30. Development kitchen Livereload Rspec Cucumber Caching is turned off
  31. 31. Development kitchen Should we turn it on?
  32. 32. Development kitchen Should we turn it on?
  33. 33. Development kitchen HTTPerf & friends:Allow us to do load testing
  34. 34. Development kitchen Apache bench$ ab -n 5 -c 5 http://127.0.0.1:3000/articles-n requests is the number of requests-c concurrency is the number of multiple requests
  35. 35. Development kitchen HTTPerf$ brew install httperf$ httperf --num-conns=20 --rate=10 --timeout=5--server=localhost --port=3000 --uri=/articles
  36. 36. Development kitchen Autobench:Allows us to measure load testing On local machines
  37. 37. Development kitchen Should each developer explicitlytest with caching turned on before pushing to master?
  38. 38. Development kitchenOr is this inefficient and confusing?
  39. 39. Development kitchen(Discuss, decide, act, observe, orient, iterate)
  40. 40. Staging KitchenCI server runs test suite twice:
  41. 41. Staging kitchenFirst Jenkins runs with caching off
  42. 42. Staging kitchenThen Jenkins runs with caching turned on
  43. 43. Staging kitchenThen code gets pushed to staging
  44. 44. Staging kitchenShould features be accepted if they only pass with caching off?
  45. 45. Staging kitchenIf so, we need a second environment,similar to staging, where caching is turned on.
  46. 46. Staging kitchen(Discuss, decide, act, observe, orient, iterate)
  47. 47. Production kitchenWhat process do we have in place to get user feedback?
  48. 48. Production kitchenDo we rely on our tools?
  49. 49. Production kitchenHow do we get user feedback?
  50. 50. Production kitchenDo we get it from our clients, who are not our users?
  51. 51. Production kitchenOr do we get it directly (somehow?)
  52. 52. To be answered:1) Do we turn caching on indevelopment?2) Do we run tests against cachingbefore pushing?3) Do we accept features thathavent passed caching?
  53. 53. Discuss

×