Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Don't Forget The Network: Your App Is Slower Than You Think (RailsConf 2016)

Don't Forget The Network: Your App Is Slower Than You Think (RailsConf 2016)

When you look at your response times, satisfied that they are "fast enough", you're forgetting an important thing: your users are on the other side of a network connection, and their browser has to process and render the data that you sent so quickly. This talk examines some often overlooked parts of web applications that can destroy your user experience even when your response times seem fantastic. We'll talk about networks, routing, client and server-side VMs, and how to measure and mitigate their issues.

André Arko

May 05, 2016
Tweet

More Decks by André Arko

Other Decks in Technology

Transcript

  1. don't forget
    the network
    your app is slower
    than you think

    View full-size slide

  2. André Arko
    @indirect

    View full-size slide

  3. The Ruby Way
    therubyway.io

    View full-size slide

  4. Routing
    your app has this

    View full-size slide

  5. Routing
    how does it work?

    View full-size slide

  6. Development
    App
    You

    View full-size slide

  7. Production
    People Router
    Server
    App
    App
    Router
    Server
    App
    App
    Router

    View full-size slide

  8. Routing
    how slow is it?

    View full-size slide

  9. Routing
    does it back up?

    View full-size slide

  10. Request time

    View full-size slide

  11. Request time
    not the time
    you measure

    View full-size slide

  12. Request time
    wall-clock time
    from real clients

    View full-size slide

  13. Request time
    make requests from
    around the world

    View full-size slide

  14. Servers
    you have no idea
    what is going on

    View full-size slide

  15. Runtime lag
    how do you tell you
    lost consciousness?

    View full-size slide

  16. Runtime lag
    you have it.

    View full-size slide

  17. Runtime lag
    you have it.
    how bad is it?

    View full-size slide

  18. VM lag
    do you have it?

    View full-size slide

  19. VM lag
    do you check for it?

    View full-size slide

  20. VM lag
    do you know how
    to check for it?

    View full-size slide

  21. Metrics
    are important

    View full-size slide

  22. Metrics
    tell you what
    is happening

    View full-size slide

  23. Metrics
    convince you
    you understand

    View full-size slide


  24. you later →

    View full-size slide

  25. Averages
    convince you
    you understand

    View full-size slide

  26. Averages
    are lie-candy
    for your brain

    View full-size slide

  27. “Normal”
    5
    -5 -4 -3 -2 -1 0 1 2 3 4
    0
    0.1
    0.2
    0.3
    0.4

    View full-size slide

  28. “Normal”
    5
    -5 -4 -3 -2 -1 0 1 2 3 4
    0
    0.1
    0.2
    0.3
    0.4

    View full-size slide

  29. Real Life
    5
    -5 -4 -3 -2 -1 0 1 2 3 4
    0
    0.1
    0.2
    0.3
    0.4

    View full-size slide

  30. brendangregg.com

    View full-size slide

  31. brendangregg.com

    View full-size slide


  32. just heard
    “w
    e
    have
    a
    great average” →

    View full-size slide

  33. The problem with averages:
    If you put one hand in a bucket of ice
    and the other in a bucket of hot coals,
    on average, you’re comfortable.
    Erik Michaels-Ober
    @sferik

    View full-size slide

  34. Averages
    mask problems

    View full-size slide

  35. 10
    0 1 2 3 4 5 6 7 8 9
    250
    0
    50
    100
    150
    200

    View full-size slide

  36. Graph
    the median

    View full-size slide

  37. 10
    0 1 2 3 4 5 6 7 8 9
    250
    0
    50
    100
    150
    200

    View full-size slide

  38. Graph
    95th percentile

    View full-size slide

  39. 10
    0 1 2 3 4 5 6 7 8 9
    250
    0
    50
    100
    150
    200

    View full-size slide

  40. Graph
    99th percentile

    View full-size slide

  41. 10
    0 1 2 3 4 5 6 7 8 9
    1000
    0
    250
    500
    750

    View full-size slide

  42. Aggregate graphs
    another average

    View full-size slide

  43. Breakout graphs
    show each source

    View full-size slide

  44. Seriously, do it
    Visualize your data

    View full-size slide

  45. graphic by Schutz and Avenue, CC-Attribution-ShareAlike, taken from from the Wikipedia article on Anscombe's quartet

    View full-size slide

  46. Average of X: 9 Average of X: 9
    Average of X: 9 Average of X: 9

    View full-size slide

  47. Average of Y: 7.50 Average of Y: 7.50
    Average of Y: 7.50 Average of Y: 7.50

    View full-size slide

  48. Average of X
    Average of Y
    Variance of X
    Variance of Y
    Correlation of X and Y
    Linear regression
    All four data sets have the same

    View full-size slide

  49. Aggregate alerts
    more dead servers
    than alive servers

    View full-size slide


  50. site’s up if any
    servers are up!

    View full-size slide

  51. Breakout alerts
    first dead server
    not all the servers

    View full-size slide

  52. So, in the end

    View full-size slide

  53. don’t forget
    the network

    View full-size slide

  54. user experience
    is all that matters
    after deploying

    View full-size slide