Stress Testing as A Culture

Stress Testing as A Culture

If you are working on a serious project, you want it to scale. The thing about scale is, you only focus on it once you really need it. I’m the CTO of an soccer social network based in Brazil. To put it mildly, soccer is big in my country. This summer, we focused our marketing on the World Cup, preparing our application to support as many users as possible. To do that, we had to benchmark and improve, but how could we load test? What tool should we use? Those are just some questions that I'll go through in this talk, that will show youhot to address this challenge so stress test you app.

98195776df79590269541395c699f816?s=128

João Moura

November 19, 2014
Tweet

Transcript

  1. Stress Testing as a Culture @joaomdmoura gioco.pro

  2. None
  3. 1,600,000,000.00 USD

  4. 1 Second

  5. 1 Second

  6. None
  7. 500 ms extra load time on results

  8. 500 ms extra load time on results drop in traffic

    20% =
  9. 0% 10% 20% 30% 40% 0 2 4 6 8

    10 Loadtime in seconds Page abandonment increase
  10. 0% 10% 20% 30% 40% 0 2 4 6 8

    10 Loadtime in seconds Page abandonment increase
  11. None
  12. None
  13. expect a web page to load in 2 seconds or

    less 47%
  14. None
  15. would not return if it took longer than 4 seconds

    75%
  16. “Information stored in our short-term memory decays quickly, which is

    why we don’t perform as well when we have to wait (…) And after 10 seconds? You can pretty much forget about it. Literally.” Our need for web speed: It’s about neuroscience http://www.webperformancetoday.com/2012/03/21/neuroscience-page-speed-web-performance/
  17. Performance per·for·mance: execution of an action

  18. João M. D. Moura @joaomdmoura gioco.pro

  19. Stress Testing as a Culture

  20. ?

  21. Why and how increase the success rate of my application

    to meet the needs related to scale?
  22. None
  23. None
  24. None
  25. None
  26. largest city in the Americas

  27. largest city in the Americas

  28. largest city in the Americas the most populous city of

    the southern hemisphere
  29. None
  30. None
  31. None
  32. None
  33. None
  34. None
  35. None
  36. Stress Test

  37. 15 requests 1 minute

  38. 1 requests 4 seconds

  39. None
  40. None
  41. 3 successfully responses

  42. None
  43. 9456 ms average time of response

  44. None
  45. None
  46. How to approach?

  47. Treat performance as a critical matter alongside design, development, and

    marketing.
  48. Set Stress Goals!

  49. None
  50. •Optimize an existing feature or asset on the page.

  51. •Optimize an existing feature or asset on the page. •Remove

    an existing feature or asset from the page.
  52. •Optimize an existing feature or asset on the page. •Remove

    an existing feature or asset from the page. •Don’t add the new feature or asset.
  53. 80 Golden Rule

  54. 80 Golden Rule

  55. 20 80 Low effort big impact

  56. 20 80 Low effort big impact

  57. 20 80 Low effort big impact Front End Back End

  58. Mobile First Performance

  59. None
  60. Billion people online Smartphones 1995 2000 2014 3.5

  61. 0% 25% 50% 75% 100% 1995 1997 1999 2001 2003

    2005 2007 2009 2011 2013 2015 2017 No Smartphone No Internet
  62. None
  63. 10 seconds on GPRS

  64. < 500ms

  65. Types of Stress Load Test

  66. Types of Stress Load Performance Test

  67. Types of Stress Load Performance Test

  68. Types of Stress Load Performance Test

  69. Stress

  70. Clients per Second Stress

  71. Clients per Second Maintain Client Load Stress

  72. Clients per Second

  73. Clients per Second

  74. Maintain Client Load

  75. Maintain Client Load

  76. 5 requests per Second

  77. What tools to use?

  78. None
  79. Apache Bench

  80. Apache Bench JMeter

  81. Apache Bench JMeter Tsung

  82. Apache Bench JMeter Tsung HTTPerf

  83. Apache Bench JMeter Tsung HTTPerf HTTPload

  84. Apache Bench JMeter Tsung HTTPerf HTTPload Trample

  85. None
  86. None
  87. Loader.io

  88. A free load testing service to stress test your web-apps

    & apis with thousands of concurrent connections.
  89. 10,000 clients / test

  90. None
  91. None
  92. Culture!

  93. What it means?

  94. None
  95. None
  96. TDD TDD

  97. TDD TDD BDD BDD

  98. TDD TDD BDD BDD *DD *DD

  99. Integrate it within your deployment process

  100. We can do this!

  101. And the World Cup?

  102. 3 successfully responses

  103. 9456 ms average time of response

  104. 1. Created missed indexes

  105. 2. Changed database architecture & relationships

  106. 3. Refactored tons of code

  107. 4. Background Jobs

  108. 5. Cache, for real! * but do it right *

  109. None
  110. None
  111. None
  112. None
  113. None
  114. None
  115. None
  116. None
  117. None
  118. None
  119. Wrap up!

  120. Wrap up! 1. Set goals, stick to it

  121. Wrap up! 1. Set goals, stick to it 2. Types

    of tests
  122. Wrap up! 1. Set goals, stick to it 2. Types

    of tests 3. Choose a tool
  123. Wrap up! 1. Set goals, stick to it 2. Types

    of tests 3. Choose a tool 4. Make it a culture
  124. None
  125. Open Source

  126. ActiveModel::Serializers Open Source

  127. Ask me for Stickers!

  128. None
  129. RubySource

  130. João M. D. Moura @joaomdmoura gioco.pro Thank You!