WebPerformance - Autobahn oder Fussgängerzone

WebPerformance - Autobahn oder Fussgängerzone

FrOSCon 2015 Vortrag.

Ad005fac83baa60843ddf2bc3bc8fe93?s=128

Stefan Wintermeyer

August 22, 2015
Tweet

Transcript

  1. 5.

    Jakob Nielsen’s book „Usability Engineering“ from 1993 Delay User reaction

    0 - 100 ms Instant 100 - 300 ms Feels sluggish 300 - 1000 ms Machine is working… 1 s+ Mental context switch 10 s+ I’ll come back later…
  2. 6.

    Web Search Delay Experiment Type of Delay Delay (ms) Duration

    (weeks) Impact on Avg. Daily Searches Pre-header 100 4 -0.20 % Pre-header 200 6 -0.59% Post-header 400 6 0.59% Post-ads 200 4 0.30% Source: https://www.igvita.com/slides/2012/webperf-crash-course.pdf
  3. 8.

    Was ist schnell? BTW: Wir sprechen in erster Linie vom

    Viewport und natürlich von allen Geräten (also auch 3G auf dem Handy).
  4. 11.

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Lorem ipsum</title> <link rel="icon"

    </head> <body> <h1>First Heading</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </body> </html> http://demo.amooma.de/webperf/disabledgzip/minimal/minimal.html
  5. 12.

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Lorem ipsum</title> <link rel="icon"

    href="data:;base64,iVBORw0KGgo="> </head> <body> <h1>First Heading</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </body> </html> http://demo.amooma.de/webperf/disabledgzip/minimal/minimal.html
  6. 13.
  7. 14.

    Start Render Speed Index DOM Elements Frankfurt http://www.webpagetest.org/result/150811_5M_G74/ 0.294s 300

    8 San Francisco http://www.webpagetest.org/result/150811_DT_GSK/ 0.494s 500 8 Sydney http://www.webpagetest.org/result/150811_AX_G7Y/ 1.498s 1500 8
  8. 15.

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Lorem ipsum</title> <link rel="icon"

    </head> <body> <h1>First Heading</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </body> </html> http://demo.amooma.de/webperf/disabledgzip/minimal/minimal-x10.html
  9. 16.

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Lorem ipsum</title> <link rel="icon"

    href="data:;base64,iVBORw0KGgo="> </head> <body> <h1>First Heading</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </body> </html> http://demo.amooma.de/webperf/disabledgzip/minimal/minimal-x10.html
  10. 17.

    Start Render Speed Index DOM Elements Frankfurt http://www.webpagetest.org/result/150811_MT_M2Y/ 0.286s 300

    17 San Francisco http://www.webpagetest.org/result/150811_SN_M2Q/ 0.494s 500 17 Sydney http://www.webpagetest.org/result/150811_47_MTS/ 1.497s 1500 17
  11. 18.

    Start Render 8 Dom Elements (1 <p>) 17 Dom Elements

    (10 <p>) Frankfurt 0.294s 0.286s San Francisco 0.494s 0.494s Sydney 1.498s 1.497s
  12. 21.

    SYN SYN, ACK ACK + GET ACK ACK Client /

    Browser Server ~14 KB 10 Segmente zu je 1.460 Byte ~28 KB 20 Segmente zu je 1.460 Byte 10 x 2n Segmente
  13. 22.

    SYN SYN, ACK ACK + GET ACK ACK Client /

    Browser Server ~14 KB ~28 KB 0 ms 40 ms 80 ms 160 ms 240 ms 120 ms 200 ms 280 ms
  14. 23.

    TCP Slow-Start KB 0 55 110 165 220 Roundtrip 1.

    2. 3. 4. 214KB 100KB 43KB 14KB 114KB 57KB 29KB 14KB
  15. 24.

    blink-dev thread • Cable profile (5Mbps / 28 ms RTT)

    • Main thread attribution in Blink o Measured via Telemetry • 69.5% of time blocked on network • 6.6% of time blocked JavaScript • 5.1% blocked on Layout • 4.5% blocked on Paint • ... No surprises here... First page load is network (latency) bound! Top 1M Alexa sites... +Ilya Grigorik @igrigorik
  16. 27.

    Download Mbps 0 2 4 6 8 WLAN 2G 3G

    4G LTE 7,5 1,8 0,1 6,1 Quelle: http://opensignal.com/reports/state-of-lte-q1-2014/
  17. 28.

    Time on LTE 0 % 25 % 50 % 75

    % 100 % Süd Korea Schweden USA Deutschland Russland 42 % 47 % 67 % 88 % 91 % Quelle: http://opensignal.com/reports/state-of-lte-q1-2014/
  18. 29.

    Von der WebPerformance mit 3G hängt der Erfolg ab. 0

    2 4 6 8 WLAN 2G 3G 4G LTE 7,5 1,8 0,1 6,1
  19. 30.

    DNS Lookup TCP Connection HTTP Request 600ms 3G Netzwerk Overhead

    200ms 200ms 200ms Bis hier weiß der Webserver noch nichts von der Anfrage.
  20. 38.

    Domain shard… all the things! 6 connections per origin
 just

    add more origins, right? Duplicate (spurious) data packets due to oversharding http://perf.fail/post/96104709544/zealous-sharding-hurts-etsy- performance Optimal number of shards? There is no such thing. Depends on particular page, device + network + network weather. Most sites overshard, and hurt themselves… Causing congestion, retransmissions, etc.
  21. 40.
  22. 41.

    0 2 4 6 8 WLAN 2G 3G 4G LTE

    7,5 1,8 0,1 6,1
  23. 42.

    0 2 4 6 8 WLAN 2G 3G 4G LTE

    7,5 1,8 0,1 6,1
  24. 43.

    0 2 4 6 8 WLAN 2G 3G 4G LTE

    7,5 1,8 0,1 6,1
  25. 46.

    0 10 20 30 40 Norwegen Schweden Finland Pakistan Slovakia

    China 30,59 16,75 16,52 0,46 0,46 0,44 Avg. Page Load Time in Sekunden
  26. 48.
  27. 49.

    Avg. Page Load Time - Sekunden Sachsen-Anhalt 0,51 Rheinland-Pfalz 0,52

    Sachsen 0,55 Brandenburg 0,59 Baden-Würthemberg 0,60 Saarland 0,62 Bayern 0,72 Hessen 0,76 Berlin 0,79 NRW 0,83 Niedersachsen 0,93 Hamburg 1,01 Schleswig-Holstein 1,07 Mecklenburg-Vorpom. 1,27 Thüringen 1,52 Bremen 1,65
  28. 53.
  29. 55.
  30. 56.
  31. 62.

    Dateiname Original kraken.io % Savings gb.gif 1.03 KB 1.03 KB

    0 % froscon_logo.png 5.39 KB 4.02 KB 25.38 % icon_retweet.gif 84 B 84 B 0 % logo_fh_rhein-sieg.png 3.93 KB 3.65 KB 7.03 % logo_luusa.png 4.83 KB 4.60 KB 4.87 % csm_HEG_Logo_1cacd1631b.png 6.61 KB 4.68 KB 29.08 % mitp__4c_dax_96dpi.jpg 24.54 KB 2.87 KB 88.29 % google-plus.png 1.47 KB 1.26 KB 14.65 % twitter.png 2.17 KB 1.28 KB 40.97 % facebook.png 1.01 KB 900 B 12.71 % kopfbild1.jpg 96.42 KB 94.00 KB 2.51 % Summe 147.48 KB 118.36 KB 19.75 %
  32. 64.
  33. 69.
  34. 70.
  35. 72.

    HTTP/2 kann mehrere Dateien parallel übertragen und benutzt nur noch

    eine TCP-Verbindung. Dadurch wird die Bandbreite optimal ausgenutzt.
  36. 80.

    Nie mehr als 100 Dateien pro Webseite. BTW: Der TCP

    keepalive_requests Default ist 100.
  37. 81.