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 Slide

  2. André Arko
    @indirect

    View Slide

  3. The Ruby Way
    therubyway.io

    View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. Routing

    View Slide

  8. Routing
    your app has this

    View Slide

  9. Routing
    how does it work?

    View Slide

  10. Development
    App
    You

    View Slide

  11. Production
    People Router
    Server
    App
    App
    Router
    Server
    App
    App
    Router

    View Slide

  12. Routing
    how slow is it?

    View Slide

  13. Routing
    does it back up?

    View Slide

  14. Request time

    View Slide

  15. Request time
    not the time
    you measure

    View Slide

  16. Request time
    wall-clock time
    from real clients

    View Slide

  17. Request time
    make requests from
    around the world

    View Slide

  18. Servers

    View Slide

  19. Servers
    you have no idea
    what is going on

    View Slide

  20. really.

    View Slide

  21. Runtime lag

    View Slide

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

    View Slide

  23. Runtime lag
    you have it.

    View Slide

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

    View Slide

  25. VM lag

    View Slide

  26. VM lag
    do you have it?

    View Slide

  27. VM lag
    do you check for it?

    View Slide

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

    View Slide

  29. Metrics

    View Slide

  30. Metrics
    are important

    View Slide

  31. Metrics
    tell you what
    is happening

    View Slide


  32. you rn →

    View Slide

  33. Metrics
    convince you
    you understand

    View Slide


  34. you later →

    View Slide

  35. Averages
    convince you
    you understand

    View Slide

  36. Averages
    are lie-candy
    for your brain

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  40. brendangregg.com

    View Slide

  41. brendangregg.com

    View Slide


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

    View Slide

  43. 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 Slide

  44. Averages
    mask problems

    View Slide

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

    View Slide

  46. Graph
    the median

    View Slide

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

    View Slide

  48. Graph
    95th percentile

    View Slide

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

    View Slide

  50. Graph
    99th percentile

    View Slide

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

    View Slide

  52. Aggregate graphs
    another average

    View Slide

  53. View Slide

  54. Breakout graphs
    show each source

    View Slide

  55. View Slide

  56. Seriously, do it
    Visualize your data

    View Slide

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

    View Slide

  58. Average of X: 9 Average of X: 9
    Average of X: 9 Average of X: 9

    View Slide

  59. Average of Y: 7.50 Average of Y: 7.50
    Average of Y: 7.50 Average of Y: 7.50

    View Slide

  60. 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 Slide

  61. Aggregate alerts
    more dead servers
    than alive servers

    View Slide


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

    View Slide

  63. Breakout alerts
    first dead server
    not all the servers

    View Slide

  64. So, in the end

    View Slide

  65. don’t forget
    the network

    View Slide

  66. user experience
    is all that matters
    after deploying

    View Slide

  67. @indirect
    [email protected]
    Questions?

    View Slide