HTTP/1.1 -> SPDY/3.1 -> HTTP/2

HTTP/1.1 -> SPDY/3.1 -> HTTP/2

5d74d743eabd2bf7d4d2f68b9d3c727d?s=128

Tatsuhiko Kubo

April 14, 2015
Tweet

Transcript

  1. HTTP/1.1 -> SPDY/3.1 -> HTTP/2 Tatsuhiko Kubo@cubicdaiya http2 RFCൃߦه೦LT@2015/04/14

  2. ࣗݾ঺հ • ٱอୡ඙(Tatsuhiko Kubo) • bokko@cubicdaiya • Software Engineer in

    Infrastructure Engineering • Mercari, Inc.
  3. is powered by SPDY/3.1(nginx)

  4. OSS࡞ͬͨΓίϯτϦϏϡʔτͨ͠Γ

  5. Agenda • HTTP/1.1Ͱ௨৴͢ΔWebαΠτͷύϑΥʔϚϯενϡʔχϯά • ↑Λ΍্ͬͨͰHTTP/2Խͯ͠Έͨ • ࣮ࡍͷWebΞϓϦέʔγϣϯ(Zabbix)Λݩʹܭଌ • Google Develper

    ToolsͰܭଌ • ࠨԼͷεςʔλεόʔʹදࣔ͞ΕͯΔ΍ͭ
  6. ೔ຊ͔Βւ֎ͷZabbix dashboardʹΞΫηε

  7. Client • MacBookPro • Google Chrome • HTTP/2༗ޮ • ϒϥ΢βΩϟογϡ͸ৗʹແޮˣ

  8. Server(ॳظঢ়ଶ) • Apache(prefork) + mod_php • த਎͸Zabbix • KeepAlive Off

    • gzipѹॖແޮ • TLS Session Cache & Tickets༗ޮ
  9. Server(ॳظঢ়ଶ) "QBDIF 1PSU HTTPS Server (PPHMF"VUI1SPYZ "QBDIF 1PSU SSLऴ୺ Ϣʔβೝূ

    Zabbix
  10. ύϑΥʔϚϯε(ॳظঢ়ଶ) ߲໨໊ ܭଌ஋ લճ ͱͷൺֱ ॳظঢ়ଶ ͱͷൺֱ 3FDFJWFESFRVFTUT  

     %BUB5SBOTGFS ,#   -PBE5JNF TFD   %0.$POUFOU-PBE FE5JNF TFD  
  11. νϡʔχϯά ͦͷ1 KeepAlive On KeepAliveΛ༗ޮʹ͢Δ

  12. ύϑΥʔϚϯε ߲໨໊ ܭଌ஋ લճ ͱͷൺֱ ॳظঢ়ଶ ͱͷൺֱ 3FDFJWFESFRVFTUT  

     %BUB5SBOTGFS ,# ,# ,# -PBE5JNF TFD TFD TFD %0.$POUFOU-PBE FE5JNF TFD TFD TFD
  13. νϡʔχϯά ͦͷ2 <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css

    AddOutputFilterByType DEFLATE text/js AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/json-rpc </IfModule> gzipѹॖΛ༗ޮʹ͢Δ
  14. ύϑΥʔϚϯε ߲໨໊ ܭଌ஋ લճ ͱͷൺֱ ॳظঢ়ଶ ͱͷൺֱ 3FDFJWFESFRVFTUT  

     %BUB5SBOTGFS ,# ,# ,# -PBE5JNF TFD TFD TFD %0.$POUFOU-PBEF E5JNF TFD TFD TFD
  15. νϡʔχϯάͦͷ3 "QBDIF 1PSU HTTPS Server (PPHMF"VUI1SPYZ "QBDIF 1PSU SSLऴ୺ Ϣʔβೝূ

    Zabbix OHJOY 1PSU SSLऴ୺ΛnginxͰߦ͏
  16. νϡʔχϯάͦͷ3 # nginx.conf # in main context worker_processes auto; tcp_nopush

    on; keepalive_timeout 65s; open_file_cache max=1000 inactive=20s; ssl_session_cache shared:SSL:30m; gzip on; gzip_comp_level 9; gzip_types text/css text/plain text/js text/javascript application/javascript application/json-rpc; # in event context accept_mutex_delay 100ms; # in event context ੩తϑΝΠϧ͸શ෦nginxͰ഑৴͢Δ
  17. ύϑΥʔϚϯε ߲໨໊ ܭଌ஋ લճ ͱͷൺֱ ॳظঢ়ଶ ͱͷൺֱ 3FDFJWFESFRVFTUT  

     %BUB5SBOTGFS ,# ,# ,# -PBE5JNF TFD TFD TFD %0.$POUFOU-PBEF E5JNF TFD TFD TFD
  18. νϡʔχϯάͦͷ4 listen 443 ssl spdy; SPDY/3.1Λ༗ޮʹ͢Δ

  19. ύϑΥʔϚϯε ߲໨໊ ܭଌ஋ લճ ͱͷൺֱ ॳظঢ়ଶ ͱͷൺֱ 3FDFJWFESFRVFTUT  

     %BUB5SBOTGFS ,# ,# ,# -PBE5JNF TFD TFD TFD %0.$POUFOU-PBEF E5JNF TFD TFD TFD
  20. νϡʔχϯάͦͷ5 HTTPS Server (PPHMF"VUI1SPYZ "QBDIF 1PSU SSLऴ୺ Ϣʔβೝূ Zabbix OHJOY

    1PSU SSLऴ୺Λh2o(HTTP/2)Ͱߦ͏ IP 1PSU
  21. ͳ͓ɺh2o͸gzipѹॖΛ αϙʔτ͍ͯ͠ͳ͍ͷͰ gzipѹॖ͸ApacheͰߦ͍·ͨ͠ (gzipѹॖࡁΈϑΝΠϧͷ഑৴͸Ͱ͖ΔΑ)

  22. ύϑΥʔϚϯε ߲໨໊ ܭଌ஋ લճ ͱͷൺֱ ॳظঢ়ଶ ͱͷൺֱ 3FDFJWFESFRVFTUT  

     %BUB5SBOTGFS ,# ,# ,# -PBE5JNF TFD TFD TFD %0.$POUFOU-PBEF E5JNF TFD TFD TFD
  23. ·ͱΊ • WebαΠτ(Zabbix)ΛHTTPαʔόͷνϡʔχϯά͚ͩͰ଎ͯ͘͠Έͨ • 4ඵ͔͔ͬͯͨWebϖʔδͷϩʔυ͕1ඵʹͳͬͨ • h2o+HTTP/2ͱnginx+SPDY/3.1Ͱ΄΅ಉ͡ • సૹྔ͸SPDY/3.1ͷ࣌ͱൺ΂ͯ7KBݮগ •

    ϔομѹॖ(HPACK)͕ޮ͍ͯΔ໛༷ • CPUό΢ϯυͳϕϯνϚʔΫͳΒh2oͷํ͕଎͍͸ͣ • ࠓճ͸ωοτϫʔΫϨΠςϯγͷ؍఺͔Βܭଌͯ͠Έ·ͨ͠