Slide 1

Slide 1 text

HTTP/ とASGI Webサーバの関係 Junya Fukuda Python Charity Talks in Japan 2021.02 - Hypercornを例に 2

Slide 2

Slide 2 text

HTTP/ とASGI Webサーバの関係 Junya Fukuda Python Charity Talks in Japan 2021.02 - Hypercornを例に 3🤔

Slide 3

Slide 3 text

•෱ా ൏໵ʢJunya Fukudaʣʢ@JunyaFffʣ •גࣜձࣾ೔ຊγεςϜٕݚʢJSLʣॴଐ ௕໺ݝͷձࣾ •GEEKLAB.NAGANO - ίϛϡχςΟεϖʔεӡӦ •Effective Python ͷಡॻձ΍ͬͯ·͢ʙ •ʢ͓͠͝ͱͰʣόϦϡʔϒοΫε •ຊ޷͖ʹѪ͞ΕΔαʔϏεΛ໨ࢦͯ͠ʢݹຊങऔɾൢചʣ ΪʔΫϥϘ௕໺ಡॻձ

Slide 4

Slide 4 text

本 流 •ASGIͬͯͳʹʁ •HTTP/2ͬͯͳʹʁ •Hypercorn×FastAPIͰετϦʔϜ •Hypercorn×FastAPIΛ࢖ͬͨHTTP/1.1 HTTP/2ੑೳଌఆ

Slide 5

Slide 5 text

本 流 •ASGIͬͯͳʹʁ •HTTP/2ͬͯͳʹʁ •Hypercorn×FastAPIͰετϦʔϜ •Hypercorn×FastAPIΛ࢖ͬͨHTTP/1.1 HTTP/2ੑೳଌఆ •HTTP/3ͱPython

Slide 6

Slide 6 text

Python Web で HTTP/2を意識したこと ありますか?

Slide 7

Slide 7 text

•HTTP/2Λҙࣝͨ͜͠ͱ͸͋·Γͳ͍ •σϓϩΠ؀ڥʹ͸ϦόʔεϓϩΩγ͍Δ͠ɺHTTP/2ؾʹ͢Δͷ͸ͦ͘͜Β͍

Slide 8

Slide 8 text

•HTTP/2Λҙࣝͨ͜͠ͱ͸͋·Γͳ͍ •σϓϩΠ؀ڥʹ͸ϦόʔεϓϩΩγ͍Δ͠ɺHTTP/2ؾʹ͢Δͷ͸ͦ͘͜Β͍ •ϩʔυόϥϯαʔ ͷ಺ଆ͸HTTP/1.1Ͱे෼

Slide 9

Slide 9 text

•HTTP/2Λҙࣝͨ͜͠ͱ͸͋·Γͳ͍ •σϓϩΠ؀ڥʹ͸ϦόʔεϓϩΩγ͍Δ͠ɺHTTP/2ؾʹ͢Δͷ͸ͦ͘͜Β͍ •ϩʔυόϥϯαʔ ͷ಺ଆ͸HTTP/1.1Ͱे෼ •ʢPure Python ͷWebαʔόͳΜͯʣ

Slide 10

Slide 10 text

•HTTP/2Λҙࣝͨ͜͠ͱ͸͋·Γͳ͍ •σϓϩΠ؀ڥʹ͸ϦόʔεϓϩΩγ͍Δ͠ɺHTTP/2ؾʹ͢Δͷ͸ͦ͘͜Β͍ •ϩʔυόϥϯαʔ ͷ಺ଆ͸HTTP/1.1Ͱे෼ •ͦΜͳͳ͔ɺASGIͱHypercornͱग़ձͬͨ •Python WebͰHTTP/2ʹ͢Δͱͳʹ͕͓͍͍͠ͷʁ •ʢPure Python ͷWebαʔόͳΜͯʣ

Slide 11

Slide 11 text

•HTTP/2Λҙࣝͨ͜͠ͱ͸͋·Γͳ͍ •σϓϩΠ؀ڥʹ͸ϦόʔεϓϩΩγ͍Δ͠ɺHTTP/2ؾʹ͢Δͷ͸ͦ͘͜Β͍ •ϩʔυόϥϯαʔ ͷ಺ଆ͸HTTP/1.1Ͱे෼ •ͦΜͳͳ͔ɺASGIͱHypercornͱग़ձͬͨ •Python WebͰHTTP/2ʹ͢Δͱͳʹ͕͓͍͍͠ͷʁ •ʢPure Python ͷWebαʔόͳΜͯʣ •HTTP/3 ௒໨લɻ࠷ޙʂʁͷHTTP/2ωλ

Slide 12

Slide 12 text

ASGIってなに?

Slide 13

Slide 13 text

ASGI •Asynchronous Server Gateway Interface ͷུ •WSGIͷޙܧ •WebαʔόͱΞϓϦέʔγϣϯͷΠϯλʔϑΣʔεͷ࢓༷

Slide 14

Slide 14 text

ASGI •Asynchronous Server Gateway Interface ͷུ •Webαʔό͕ΞϓϦέʔγϣϯͷ async/await ʹରԠ •WSGIͷޙܧ •WebαʔόͱΞϓϦέʔγϣϯͷΠϯλʔϑΣʔεͷ࢓༷

Slide 15

Slide 15 text

ASGI •Asynchronous Server Gateway Interface ͷུ •Webαʔό͕ΞϓϦέʔγϣϯͷ async/await ʹରԠ •WSGIͷޙܧ •WebαʔόͱΞϓϦέʔγϣϯͷΠϯλʔϑΣʔεͷ࢓༷ https://www.youtube.com/watch?v=EwG5EWKu8nw ASGIʢඇಉظαʔόήʔτ΢ΣΠΠϯλʔϑΣʔεʣͷ֓ཁ (Junya Fukuda) [PyCon JP 2020]

Slide 16

Slide 16 text

ASGI •Asynchronous Server Gateway Interface ͷུ •Webαʔό͕ΞϓϦέʔγϣϯͷ async/await ʹରԠ •WSGIͷޙܧ •WebαʔόͱΞϓϦέʔγϣϯͷΠϯλʔϑΣʔεͷ࢓༷ https://www.youtube.com/watch?v=EwG5EWKu8nw ASGIʢඇಉظαʔόήʔτ΢ΣΠΠϯλʔϑΣʔεʣͷ֓ཁ (Junya Fukuda) [PyCon JP 2020] •ෳ਺ͷҰൠతͳϓϩτίϧΛॲཧՄೳʮHTTP/1.1ʯʮHTTP/2ʯʮWebsocketʯ

Slide 17

Slide 17 text

ASGI •୅දతͳASGIؔ࿈ͷαʔόͱϑϨʔϜϫʔΫ

Slide 18

Slide 18 text

HTTP/2ってなに?

Slide 19

Slide 19 text

HTTP/2 •HTTP/̍.1͔Β16೥ͷࡀ݄Λܦͯɺ2015೥ʹRFC •଎౓վળΛ໨తͱͨ͠࢓༷

Slide 20

Slide 20 text

HTTP/2 •HTTP/̍.1͔Β16೥ͷࡀ݄Λܦͯɺ2015೥ʹRFC •αʔόϓογϡ •ϔομʔͷѹॖ •ετϦʔϜʢϦΫΤετͷଟॏԽʣ •଎౓վળΛ໨తͱͨ͠࢓༷

Slide 21

Slide 21 text

HTTP/2 •HTTP/̍.1͔Β16೥ͷࡀ݄Λܦͯɺ2015೥ʹRFC •αʔόϓογϡ •ϔομʔͷѹॖ •ετϦʔϜʢϦΫΤετͷଟॏԽʣ •଎౓վળΛ໨తͱͨ͠࢓༷

Slide 22

Slide 22 text

HTTP/2 •HTTP/̍.1͔Β16೥ͷࡀ݄Λܦͯɺ2015೥ʹRFC •αʔόϓογϡ •ϔομʔͷѹॖ •ετϦʔϜʢϦΫΤετͷଟॏԽʣ •଎౓վળΛ໨తͱͨ͠࢓༷ IUUQTHSPVQTHPPHMFDPNBDISPNJVNPSHHCMJOLEFWD,S:-WN26#:NW08#,;(P"2"+ QMJ *OUFOUUP3FNPWF)551BOEH26*$TFSWFSQVTI

Slide 23

Slide 23 text

HTTP/2 •HTTP/̍.1͔Β16೥ͷࡀ݄Λܦͯɺ2015೥ʹRFC •αʔόϓογϡ •ϔομʔͷѹॖ •ετϦʔϜʢϦΫΤετͷଟॏԽʣ •଎౓վળΛ໨తͱͨ͠࢓༷ IUUQTHSPVQTHPPHMFDPNBDISPNJVNPSHHCMJOLEFWD,S:-WN26#:NW08#,;(P"2"+ QMJ *OUFOUUP3FNPWF)551BOEH26*$TFSWFSQVTI →ɹ103 Early Hints

Slide 24

Slide 24 text

HTTP/2 •HTTP/̍.1͔Β16೥ͷࡀ݄Λܦͯɺ2015೥ʹRFC •αʔόϓογϡ •ϔομʔͷѹॖ •ετϦʔϜʢϦΫΤετͷଟॏԽʣ •଎౓վળΛ໨తͱͨ͠࢓༷

Slide 25

Slide 25 text

HTTP/2 •ετϦʔϜ

Slide 26

Slide 26 text

HTTP/2 •ετϦʔϜ ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊

Slide 27

Slide 27 text

HTTP/2 •ετϦʔϜ ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊

Slide 28

Slide 28 text

HTTP/2 ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊ ‣ ΫϥΠΞϯτ ‣ αʔόʔ

Slide 29

Slide 29 text

HTTP/2 ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊ ‣ ΫϥΠΞϯτ ‣ αʔόʔ

Slide 30

Slide 30 text

HTTP/2 ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊ ‣ ΫϥΠΞϯτ ‣ αʔόʔ

Slide 31

Slide 31 text

HTTP/2 ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊ ‣ ΫϥΠΞϯτ ‣ αʔόʔ

Slide 32

Slide 32 text

HTTP/2 ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊ ‣ ΫϥΠΞϯτ ‣ αʔόʔ

Slide 33

Slide 33 text

HTTP/2 ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊ ‣ ΫϥΠΞϯτ ‣ αʔόʔ HTTP/̍.1ͷϦΫΤετ-Ϩεϙ ϯε͸ɺৗʹॱ൪Λอͪಉظత ʹߦΘΕΔඞཁ͕͋Δ

Slide 34

Slide 34 text

HTTP/2 ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊ ‣ ΫϥΠΞϯτ ‣ αʔόʔ HTTP/̍.1ͷϦΫΤετ-Ϩεϙ ϯε͸ɺৗʹॱ൪Λอͪಉظత ʹߦΘΕΔඞཁ͕͋Δ WebγεςϜͰ͸ ը໘දࣔ࣌ʹ80ϦΫΤετ

Slide 35

Slide 35 text

HTTP/2 ‣ ྫ͑͹օ͞Μ͕࢖͍ͬͯΔGmail

Slide 36

Slide 36 text

HTTP/2 ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊ ‣ ΫϥΠΞϯτ ‣ αʔόʔ ‣ TCP × 6ຊ

Slide 37

Slide 37 text

HTTP/2 ‣ HTTP/̍.1ͷ໰୊఺Λղܾ͢ΔͨΊͷ࢓༷ •1ͭͷϦΫΤετ͕׬ྃ͢Δ·Ͱݪଇɺ࣍ͷϦΫΤετΛૹΕͳ͍໰୊ ‣ ΫϥΠΞϯτ ‣ αʔόʔ

Slide 38

Slide 38 text

HTTP/2 •ετϦʔϜ ‣ ΫϥΠΞϯτ ‣ αʔόʔ ‣ ΫϥΠΞϯτ ‣ αʔόʔ HTTP/1.1 HTTP/2

Slide 39

Slide 39 text

HTTP/2 •ετϦʔϜ ‣ ΫϥΠΞϯτ ‣ αʔόʔ ‣ ΫϥΠΞϯτ ‣ αʔόʔ HTTP/1.1 HTTP/2

Slide 40

Slide 40 text

HTTP/2 •ετϦʔϜ ‣ ΫϥΠΞϯτ ‣ αʔόʔ ‣ ΫϥΠΞϯτ ‣ αʔόʔ ‣ 1ͭͷTCPͷίωΫγϣϯͷதͰॱ൪଴ͪΛ͢Δ͜ͱͳ͘ɺฒྻʹॲཧ HTTP/1.1 HTTP/2 ฒྻʹॲཧ

Slide 41

Slide 41 text

HTTP/2 •ετϦʔϜ ‣ ΫϥΠΞϯτ ‣ αʔόʔ ‣ ΫϥΠΞϯτ ‣ αʔόʔ HTTP/1.1 HTTP/2 ฒྻʹॲཧ ‣ 1ͭͷTCPͷίωΫγϣϯͷதͰॱ൪଴ͪΛ͢Δ͜ͱͳ͘ɺฒྻʹॲཧ

Slide 42

Slide 42 text

HTTP/2 対応 ASGI Web Server •ASGI Web ServerͷҰཡ Daphne Mangum IUUQTHJUIVCDPN fl PSJNPOENBODBBXFTPNFBTHJ

Slide 43

Slide 43 text

HTTP/2 対応 ASGI Web Server •ASGI Web ServerͷҰཡ Daphne Mangum IUUQTHJUIVCDPN fl PSJNPOENBODBBXFTPNFBTHJ

Slide 44

Slide 44 text

HTTP/2 対応 ASGI Web Server •ASGI WebServer ͱ͍͑͹ Uvicorn •·ͩHTTP/2ະରԠ ʢରԠ༧ఆ͋Γʣ Uvicorn currently supports HTTP/1.1 and WebSockets. Support for HTTP/2 is planned. Uvicorn͸ݱࡏɺHTTP/1.1ͱWebSocketsΛαϙʔτ͍ͯ͠·͢ɻ HTTP/2ͷαϙʔτ͕༧ఆ͞Ε͍ͯ·͢ɻ IUUQTXXXVWJDPSOPSH

Slide 45

Slide 45 text

HTTP/2 対応 ASGI Web Server •ASGI࢓༷ͷରԠঢ়گ Framework HTTP WebSockets Server Push WebSocket HTTP Hypercorn 1 ○ 2 ○ 1 ○ 2 ○ ○ ○ Uvicorn 1 ○ 2 × 1 ○ 2 × × × Daphne 1 ○ 2 ○ 1 ○ 2 × × × Mangum 1 ○ 2 × 1 ○ 2 × × ×

Slide 46

Slide 46 text

HTTP/2 対応 ASGI Web Server •ASGI࢓༷ͷରԠঢ়گ Framework HTTP WebSockets Server Push WebSocket HTTP Hypercorn 1 ○ 2 ○ 1 ○ 2 ○ ○ ○ Uvicorn 1 ○ 2 × 1 ○ 2 × × × Daphne 1 ○ 2 ○ 1 ○ 2 × × × Mangum 1 ○ 2 × 1 ○ 2 × × ×

Slide 47

Slide 47 text

HTTP/2 対応 ASGI Web Server •ϋΠύʔίʔϯͱಡΈ·͢ •WSGI Web αʔόͷGunicornʹΠϯεύΠΞ͞Ε͍ͯΔ •HTTP / 1ɺHTTP / 2ɺWebSocketʢHTTP / 1͓ΑͼHTTP / 2ܦ༝ʣαϙʔτ •worker ͷλΠϓʹ asyncio,uvloop,trio ΛࢦఆՄೳ •worker ਺ΛࢦఆՄೳ

Slide 48

Slide 48 text

本 HTTP/2 使 道 •HTTP/2αʔόͱΞϓϦέʔγϣϯͷϦΫΤετɾϨεϙϯεʹண໨ •੩తϑΝΠϧͷ഑৴͸ผͰɻΦϒδΣΫτετϨʔδ΍CDNͰ

Slide 49

Slide 49 text

本 HTTP/2 使 道 ೥୅ͷίϯςφ࣌୅ͷ1ZUIPOΞʔΩςΫνϟσϓϩΠ TIJCVLBXB <1Z$PO+1> IUUQTXXXZPVUVCFDPNXBUDI W0Y3O%-6OP*TUBSU •HTTP/2αʔόͱΞϓϦέʔγϣϯͷϦΫΤετɾϨεϙϯεʹண໨ •੩తϑΝΠϧͷ഑৴͸ผͰɻΦϒδΣΫτετϨʔδ΍CDNͰ

Slide 50

Slide 50 text

Hypercornを例に ストリーム(多重化)を

Slide 51

Slide 51 text

Hypercorn •؆୯ͳWebΞϓϦέʔγϣϯΛHypercornͰಈ͔͢ •ϒϥ΢β͔ΒJavascriptͰΞΫηε •WebΞϓϦέʔγϣϯͷίʔυ͸ಉ͡ •HTTP/1.1ͱHTTP/2ͷҧ͍ΛɺΈͯΈ·͠ΐ͏

Slide 52

Slide 52 text

؀ڥ •Hypercorn •fastapi 0.61.1 0.11.0 Webαʔό Web Framework ⁶ ⁶ ʢASGIʣ ʢHTTP/2ʣ ʢHTTP/1.1ʣ Hypercorn

Slide 53

Slide 53 text

؀ڥ •Hypercorn •fastapi 0.61.1 0.11.0 Webαʔό Web Framework ⁶ ⁶ ʢASGIʣ ʢHTTP/2ʣ ʢHTTP/1.1ʣ Hypercorn

Slide 54

Slide 54 text

処理 @app.get("/message/{id}") async def get_message(id:str): await asyncio.sleep(3) return {"text": f"spam, egg, spam and spam!, {id}!"}

Slide 55

Slide 55 text

処理 requestButton.onclick = async function() { result = []; for (let i = 0; i < 24; i++) { result.push(fetch(`/message/${i}/`)); } await Promise.all(result); }

Slide 56

Slide 56 text

HTTP/1.1 場合

Slide 57

Slide 57 text

HTTP/1.1 場合

Slide 58

Slide 58 text

HTTP/1.1 場合

Slide 59

Slide 59 text

HTTP/1.1 場合 TFDˎຊ

Slide 60

Slide 60 text

HTTP/1.1 場合 TFDˎຊ TFDˎຊ

Slide 61

Slide 61 text

HTTP/1.1 場合 TFDˎຊ TFDˎຊ TFDˎຊ

Slide 62

Slide 62 text

HTTP/1.1 場合 TFDˎຊ TFDˎຊ TFDˎຊ TFDˎຊ

Slide 63

Slide 63 text

HTTP/1.1 場合 TFDˎຊ TFDˎຊ TFDˎຊ TFDˎຊ τʔλϧTFD

Slide 64

Slide 64 text

HTTP/2 場合

Slide 65

Slide 65 text

HTTP/2 場合

Slide 66

Slide 66 text

HTTP/2 場合 TFDˎຊ

Slide 67

Slide 67 text

HTTP/2 場合 TFDˎຊ τʔλϧTFD

Slide 68

Slide 68 text

HTTP/2とHTTP/1.1 性能を⽐較

Slide 69

Slide 69 text

HTTP/1.1 HTTP/2 ⽐較 •࣮ߦ؀ڥ͸ϩʔΧϧϚγϯ •ࢦඪ͸ɺॲཧͷऴྃ·Ͱʹ͔͔ͬͨ࣌ؒʗ1ඵ͋ͨΓʹࡹ͚ΔϦΫΤετ਺ •ੑೳଌఆπʔϧͱͯ͠ɺh2load ίϚϯυΛ࢖༻͢Δ •؆୯ͳWebΞϓϦέʔγϣϯΛHypercornͰಈ͔͢

Slide 70

Slide 70 text

HTTP/1.1 HTTP/2 ⽐較 •࣮ߦ؀ڥ͸ϩʔΧϧϚγϯ •ࢦඪ͸ɺॲཧͷऴྃ·Ͱʹ͔͔ͬͨ࣌ؒʗ1ඵ͋ͨΓʹࡹ͚ΔϦΫΤετ਺ •ੑೳଌఆπʔϧͱͯ͠ɺh2load ίϚϯυΛ࢖༻͢Δ •؆୯ͳWebΞϓϦέʔγϣϯΛHypercornͰಈ͔͢

Slide 71

Slide 71 text

HTTP/1.1 HTTP/2 ⽐較 •࣮ߦ؀ڥ͸ϩʔΧϧϚγϯ •ࢦඪ͸ɺॲཧͷऴྃ·Ͱʹ͔͔ͬͨ࣌ؒʗ1ඵ͋ͨΓʹࡹ͚ΔϦΫΤετ਺ •ੑೳଌఆπʔϧͱͯ͠ɺh2load ίϚϯυΛ࢖༻͢Δ •؆୯ͳWebΞϓϦέʔγϣϯΛHypercornͰಈ͔͢

Slide 72

Slide 72 text

HTTP/1.1 HTTP/2 ⽐較 αʔό HTTP/1.1 HTTP/2 •Hypercorn •fastapi 0.61.1 0.11.0 Webαʔό Web Framework ⁶ ⁶ ʢASGIʣ ʢHTTP/2ʣ ʢHTTP/1.1ʣ

Slide 73

Slide 73 text

HTTP/1.1 HTTP/2 ⽐較 αʔό HTTP/1.1 HTTP/2 •Hypercorn •fastapi 0.61.1 0.11.0 Webαʔό Web Framework ⁶ ⁶ ʢASGIʣ ʢHTTP/2ʣ ʢHTTP/1.1ʣ

Slide 74

Slide 74 text

ϋʔυ΢ΣΞ؀ڥ •Macbook Pro •2.6 GHz 6ίΞ Intel Core i7 •ϝϞϦ 16GB HTTP/1.1 HTTP/2 ⽐較

Slide 75

Slide 75 text

HTTP/1.1 HTTP/2 ⽐較 •h2load ίϚϯυ Φϓγϣϯ ҙຯ -n ૯ϦΫΤετ਺ -c ΫϥΠΞϯτ਺ɻಉ࣌ΞΫηε਺ -p ϓϩτίϧʢࣗಈ൑ผʣ •h2load -c 100 -n 10000 https://127.0.0.1:8000/query

Slide 76

Slide 76 text

HTTP/1.1 HTTP/2 ⽐較 ҎԼ3ͭ৚݅ •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100 •ΫϥΠΞϯτಉ࣌઀ଓ 50, ϦΫΤετ਺ 5000 •ΫϥΠΞϯτಉ࣌઀ଓ 100, ϦΫΤετ਺ 10000

Slide 77

Slide 77 text

HTTP/1.1 HTTP/2 ⽐較 ҎԼ3ͭ৚݅ •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100 •ΫϥΠΞϯτಉ࣌઀ଓ 50, ϦΫΤετ਺ 5000 •ΫϥΠΞϯτಉ࣌઀ଓ 100, ϦΫΤετ਺ 10000 ࢦඪ •ॲཧͷऴྃ·Ͱʹ͔͔ͬͨ࣌ؒ •1ඵ͋ͨΓͷॲཧͨ͠ϦΫΤετ਺

Slide 78

Slide 78 text

HTTP/1.1 HTTP/2 ⽐較 ҎԼ3ͭ৚݅ •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100 •ΫϥΠΞϯτಉ࣌઀ଓ 50, ϦΫΤετ਺ 5000 •ΫϥΠΞϯτಉ࣌઀ଓ 100, ϦΫΤετ਺ 10000 ࢦඪ •ॲཧͷऴྃ·Ͱʹ͔͔ͬͨ࣌ؒ •1ඵ͋ͨΓͷॲཧͨ͠ϦΫΤετ਺ → ୹͍ͱྑ͍ → ଟ͍ͱྑ͍

Slide 79

Slide 79 text

HTTP/1.1 HTTP/2 ⽐較 •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100

Slide 80

Slide 80 text

HTTP/1.1 HTTP/2 ⽐較 ऴྃ࣌ؒ [s] •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100

Slide 81

Slide 81 text

HTTP/1.1 HTTP/2 ⽐較 ऴྃ࣌ؒ [s] •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100 ϦΫΤετ [s]

Slide 82

Slide 82 text

HTTP/1.1 HTTP/2 ⽐較 ऴྃ࣌ؒ [s] •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100 ϦΫΤετ [s] HTTP/1.1 HTTP/2 HTTP/1.1 HTTP/2

Slide 83

Slide 83 text

🤔

Slide 84

Slide 84 text

HTTP/1.1 HTTP/2 ⽐較 ऴྃ࣌ؒ [s] •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100 ϦΫΤετ [s] HTTP/1.1 HTTP/2 HTTP/1.1 HTTP/2

Slide 85

Slide 85 text

HTTP/1.1 HTTP/2 ⽐較 •ΫϥΠΞϯτಉ࣌઀ଓ 50, ϦΫΤετ਺ 5000 ऴྃ࣌ؒ [s] ϦΫΤετ [s] HTTP/1.1 HTTP/2 HTTP/1.1 HTTP/2

Slide 86

Slide 86 text

HTTP/1.1 HTTP/2 ⽐較 •ΫϥΠΞϯτಉ࣌઀ଓ 100, ϦΫΤετ਺ 10000 ऴྃ࣌ؒ [s] ϦΫΤετ [s] HTTP/1.1 HTTP/2 HTTP/1.1 HTTP/2

Slide 87

Slide 87 text

🤔

Slide 88

Slide 88 text

HTTP/2 •HTTP/̍.1͔Β16೥ͷࡀ݄Λܦͯɺ2015೥ʹRFC •αʔόϓογϡ •ϔομʔͷѹॖ •ετϦʔϜʢϦΫΤετͷଟॏԽʣ •଎౓վળΛ໨తʹͨ͠࢓༷

Slide 89

Slide 89 text

HTTP/2 •HTTP/̍.1͔Β16೥ͷࡀ݄Λܦͯɺ2015೥ʹRFC •αʔόϓογϡ •ϔομʔͷѹॖ •ετϦʔϜʢϦΫΤετͷଟॏԽʣ •଎౓վળΛ໨తʹͨ͠࢓༷

Slide 90

Slide 90 text

HTTP/1.1 HTTP/2 ⽐較 •h2load — help Max concurrent streams to issue per session. When http/1.1 is used, this speci fi es the number of HTTP pipelining requests in- fl ight. ηογϣϯ͝ͱʹൃߦ͢Δ࠷େಉ࣌ετϦʔϜ਺ɻ http/1.1 Λ࢖༻͢Δ৔߹ɺ HTTP ύΠϓϥΠϯϦΫΤετ ͷ਺Λࢦఆ͠·͢ɻ -m, --max-concurrent-streams=

Slide 91

Slide 91 text

HTTP/1.1 HTTP/2 ⽐較 •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100, ετϦʔϜ 5

Slide 92

Slide 92 text

HTTP/1.1 HTTP/2 ⽐較 ऴྃ࣌ؒ [s] •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100, ετϦʔϜ 5

Slide 93

Slide 93 text

HTTP/1.1 HTTP/2 ⽐較 ऴྃ࣌ؒ [s] •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100, ετϦʔϜ 5 ϦΫΤετ [s]

Slide 94

Slide 94 text

HTTP/1.1 HTTP/2 ⽐較 ऴྃ࣌ؒ [s] •ΫϥΠΞϯτಉ࣌઀ଓ 10, ϦΫΤετ਺ 100, ετϦʔϜ 5 ϦΫΤετ [s] HTTP/1.1 HTTP/2 HTTP/1.1 HTTP/2

Slide 95

Slide 95 text

HTTP/1.1 HTTP/2 ⽐較 •ΫϥΠΞϯτಉ࣌઀ଓ 50, ϦΫΤετ਺ 5000, ετϦʔϜ 5 ऴྃ࣌ؒ [s] ϦΫΤετ [s] HTTP/1.1 HTTP/2 HTTP/1.1 HTTP/2

Slide 96

Slide 96 text

HTTP/1.1 HTTP/2 ⽐較 •ΫϥΠΞϯτಉ࣌઀ଓ 100, ϦΫΤετ਺ 10000, ετϦʔϜ 5 ऴྃ࣌ؒ [s] ϦΫΤετ [s] HTTP/1.1 HTTP/2 HTTP/1.1 HTTP/2

Slide 97

Slide 97 text

HTTP/1.1 HTTP/2 ⽐較 ετϦʔϜͳ͠ ετϦʔϜ͋Γ •ΫϥΠΞϯτಉ࣌઀ଓ 100, ϦΫΤετ਺ 10000, ετϦʔϜ 5 ετϦʔϜͳ͠ ετϦʔϜ͋Γ ऴྃ࣌ؒ [s] ϦΫΤετ [s] HTTP/1.1 HTTP/2 HTTP/1.1 HTTP/2

Slide 98

Slide 98 text

•ϦΫΤετͷଟॏԽ͕͞Ε͍ͯΔͱ͜ΖͰ͋Ε͹HTTP/2͸ɺ͸΍͍

Slide 99

Slide 99 text

•WebαΠτ΁ͷ1ճͷΞΫηεͰɺෳ਺ճαʔό΁ϦΫΤετΛ৔߹ •ϦΫΤετͷଟॏԽ͕͞Ε͍ͯΔͱ͜ΖͰ͋Ε͹HTTP/2͸ɺ͸΍͍

Slide 100

Slide 100 text

→ γεςϜ؂ࢹμογϡϘʔυ •WebαΠτ΁ͷ1ճͷΞΫηεͰɺෳ਺ճαʔό΁ϦΫΤετΛ৔߹ → ϦΞϧλΠϜσʔλ → νϟοτΞϓϦ •ϦΫΤετͷଟॏԽ͕͞Ε͍ͯΔͱ͜ΖͰ͋Ε͹HTTP/2͸ɺ͸΍͍

Slide 101

Slide 101 text

→ γεςϜ؂ࢹμογϡϘʔυ •WebαΠτ΁ͷ1ճͷΞΫηεͰɺෳ਺ճαʔό΁ϦΫΤετΛ৔߹ → ϦΞϧλΠϜσʔλ → νϟοτΞϓϦ •طଘͷαΠτͰܧ͗଍͠ܧ͗଍͠ʹͳͬͯ͠·͍ͬͯΔ৔߹ʢ΍Ήͳ͘ʣ •ϦΫΤετͷଟॏԽ͕͞Ε͍ͯΔͱ͜ΖͰ͋Ε͹HTTP/2͸ɺ͸΍͍

Slide 102

Slide 102 text

•HTTP/2Կ͕͓͍͍͠ͷʁ

Slide 103

Slide 103 text

•HTTP/2Կ͕͓͍͍͠ͷʁ → ଎౓͕վળͷՄೳੑ

Slide 104

Slide 104 text

•HTTP/2Կ͕͓͍͍͠ͷʁ •ࣗ͝਎ͷPython Web Application Λ͝ཡʹͳͬͯΈ͍ͯͩ͘͞ɻ •ϒϥ΢βͷσόοΨΛ։͍ͯϦϩʔυ → ଎౓͕վળͷՄೳੑ

Slide 105

Slide 105 text

•HTTP/2Կ͕͓͍͍͠ͷʁ •ࣗ͝਎ͷPython Web Application Λ͝ཡʹͳͬͯΈ͍ͯͩ͘͞ɻ •ϒϥ΢βͷσόοΨΛ։͍ͯϦϩʔυ •Protocol=HTTP/1.1ʹͳ͍ͬͯΔʢLBͷ಺ଆ͕HTTP/1.1ͷՄೳੑ΋ʣ → ଎౓͕վળͷՄೳੑ

Slide 106

Slide 106 text

•HTTP/2Կ͕͓͍͍͠ͷʁ •Typeʹ fetch ΍ xhr ͕ଟ͍ •ࣗ͝਎ͷPython Web Application Λ͝ཡʹͳͬͯΈ͍ͯͩ͘͞ɻ •ϒϥ΢βͷσόοΨΛ։͍ͯϦϩʔυ •Protocol=HTTP/1.1ʹͳ͍ͬͯΔʢLBͷ಺ଆ͕HTTP/1.1ͷՄೳੑ΋ʣ → ଎౓͕վળͷՄೳੑ

Slide 107

Slide 107 text

•HTTP/2Կ͕͓͍͍͠ͷʁ •Typeʹ fetch ΍ xhr ͕ଟ͍ •ࣗ͝਎ͷPython Web Application Λ͝ཡʹͳͬͯΈ͍ͯͩ͘͞ɻ •ϒϥ΢βͷσόοΨΛ։͍ͯϦϩʔυ •Protocol=HTTP/1.1ʹͳ͍ͬͯΔʢLBͷ಺ଆ͕HTTP/1.1ͷՄೳੑ΋ʣ

Slide 108

Slide 108 text

•HTTP/2Կ͕͓͍͍͠ͷʁ •HTTP/2ͷWebserver Hypercorn ʹ͢Δ͜ͱͰ଎౓վળ͕ΈΒΕΔ •Typeʹ fetch ΍ xhr ͕ଟ͍ •ࣗ͝਎ͷPython Web Application Λ͝ཡʹͳͬͯΈ͍ͯͩ͘͞ɻ •ϒϥ΢βͷσόοΨΛ։͍ͯϦϩʔυ •Protocol=HTTP/1.1ʹͳ͍ͬͯΔʢLBͷ಺ଆ͕HTTP/1.1ͷՄೳੑ΋ʣ → ଎౓͕վળͷՄೳੑ

Slide 109

Slide 109 text

•HTTP/2Կ͕͓͍͍͠ͷʁ •Typeʹ fetch ΍ xhr ͕ଟ͍ •ࣗ͝਎ͷPython Web Application Λ͝ཡʹͳͬͯΈ͍ͯͩ͘͞ɻ •ϒϥ΢βͷσόοΨΛ։͍ͯϦϩʔυ •Protocol=HTTP/1.1ʹͳ͍ͬͯΔʢLBͷ಺ଆ͕HTTP/1.1ͷՄೳੑ΋ʣ ͔΋͠Ε·ͤΜ •HTTP/2ͷWebserver Hypercorn ʹ͢Δ͜ͱͰ଎౓վળ͕ΈΒΕΔ → ଎౓͕վળͷՄೳੑ

Slide 110

Slide 110 text

•AWSͰσϓϩΠ͍ͯ͠Δ৔߹ •ALB ʹ ಺ଆ͸HTTP/2 ະରԠͷͨΊɺHTTP/̍.1 ϒϥ΢β ALB Web Server Web FW )551 )551 84(*"4(*

Slide 111

Slide 111 text

•AWSͰσϓϩΠ͍ͯ͠Δ৔߹ •ALB ʹ ಺ଆ͸HTTP/2 ະରԠͷͨΊɺHTTP/̍.1 •NLB ʹ 2020೥6݄ʹ಺ଆHTTP/2ରԠ͍ͯ͠Δ ϒϥ΢β Ϧόʔε ϓϩΩγ Hyper corn Web FW )551 )551 "4(* IUUQTBXTBNB[PODPNKQBCPVUBXTXIBUTOFXOFUXPSLMPBECBMBODFSOPXTVQQPSUTUMTBMQOQPMJDJFT

Slide 112

Slide 112 text

2 •WSGIΞϓϦέʔγϣϯͷ৔߹ •HypercornʢASGI Webαʔό͸WSGIରԠ͍ͯ͠·͢ʣͰσϓϩΠՄೳ •ࢼͯ͠ΈΔՁ஋͕͋Δ͔΋ʂʁ •Django 2ܥ - wsgi.pyΛϥοϓ͢Δ͚ͩ from hypercorn.middleware import AsyncioWSGIMiddleware import sampleproject.wsgi as wsgi_app asyncio_app = AsyncioWSGIMiddleware(wsgi_app.application) https://github.com/jrfk/django2-hypercorn

Slide 113

Slide 113 text

選択肢 •GunicornˎWSGIϑϨʔϜϫʔΫ •GunicornˎmeinheldˎWSGIϑϨʔϜϫʔΫ •celeryˎGunicornˎWSGIϑϨʔϜϫʔΫ •UvicornˎASGIϑϨʔϜϫʔΫ

Slide 114

Slide 114 text

選択肢 •GunicornˎWSGIϑϨʔϜϫʔΫ •GunicornˎmeinheldˎWSGIϑϨʔϜϫʔΫ •celeryˎGunicornˎWSGIϑϨʔϜϫʔΫ •UvicornˎASGIϑϨʔϜϫʔΫ •HypercornˎASGIϑϨʔϜϫʔΫ/WSGIϑϨʔϜϫʔΫ

Slide 115

Slide 115 text

選択肢 •GunicornˎWSGIϑϨʔϜϫʔΫ •GunicornˎmeinheldˎWSGIϑϨʔϜϫʔΫ •celeryˎGunicornˎWSGIϑϨʔϜϫʔΫ •UvicornˎASGIϑϨʔϜϫʔΫ •HypercornˎASGIϑϨʔϜϫʔΫ/WSGIϑϨʔϜϫʔΫ

Slide 116

Slide 116 text

参考資料 •How to serve HTTP/2 using Python IUUQTNFEJVNDPNQZUIPOQBOEFNPOJVNIPXUPTFSWFIUUQVTJOHQZUIPOFCCEF ff •HTTP/1 should die IUUQTNFEJVNDPN!QHKPOFTIUUQTIPVMEEJFCEF •Hypercorn IUUQTQHKPOFTHJUMBCJPIZQFSDPSOJOEFYIUNM •jrfk / fastapi-hypercorn_Performance-measurement IUUQTHJUIVCDPNKSGLGBTUBQJIZQFSDPSO@1FSGPSNBODFNFBTVSFNFOU

Slide 117

Slide 117 text

HTTP/ とASGI Webサーバの関係 Junya Fukuda Python Charity Talks in Japan 2021.02 - Hypercornを例に 2

Slide 118

Slide 118 text

HTTP/ とASGI Webサーバの関係 Junya Fukuda Python Charity Talks in Japan 2021.02 - Hypercornを例に 3🎉

Slide 119

Slide 119 text

HTTP/3とPython

Slide 120

Slide 120 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨

Slide 121

Slide 121 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ

Slide 122

Slide 122 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ

Slide 123

Slide 123 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ

Slide 124

Slide 124 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ •HTTP/2 ͔Β5೥ ͳͥͰͰ͖ͯͨͷ͔

Slide 125

Slide 125 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ •HTTP/2 ͔Β5೥ ͳͥͰͰ͖ͯͨͷ͔ HTTP/1.0 HTTP/2 1990 2000 2010 HTTP/0.9 HTTP/1.1 1997 1999 2015

Slide 126

Slide 126 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ •HTTP/2 ͔Β5೥ ͳͥͰͰ͖ͯͨͷ͔ HTTP/1.0 HTTP/2 1990 2000 2010 2021 HTTP/0.9 HTTP/1.1 1997 1999 2015

Slide 127

Slide 127 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ •HTTP/2 ͔Β5೥ ͳͥͰͰ͖ͯͨͷ͔ HTTP/1.0 HTTP/2 1990 2000 2010 2021 HTTP/0.9 HTTP/1.1 1997 1999 2015 HTTP/3 QUIC

Slide 128

Slide 128 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ •HTTP/2 ͔Β5೥ ͳͥͰͰ͖ͯͨͷ͔ •ͦΕ͸΋ͪΖΜɺHTTP/2ʹ΋՝୊͕͔͋ͬͨΒ

Slide 129

Slide 129 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ •HTTP/2 ͔Β5೥ ͳͥͰͰ͖ͯͨͷ͔ •ͦΕ͸΋ͪΖΜɺHTTP/2ʹ΋՝୊͕͔͋ͬͨΒ •՝୊…ͦΕ͸…

Slide 130

Slide 130 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ •HTTP/2 ͔Β5೥ ͳͥͰͰ͖ͯͨͷ͔ •ͦΕ͸΋ͪΖΜɺHTTP/2ʹ΋՝୊͕͔͋ͬͨΒ •՝୊... 🙏

Slide 131

Slide 131 text

HTTP/3 •HTTP/2ʹ͙࣍৽͍͠HTTPͷن֨ •TCP→UDPʹ QUIC - UDPͷసૹϓϩτίϧ •HTTP/2 ͔Β5೥ ͳͥͰͰ͖ͯͨͷ͔ •ͦΕ͸΋ͪΖΜɺHTTP/2ʹ΋՝୊͕͔͋ͬͨΒ •՝୊... 🙏 HTTP/3 explained - https://http3-explained.haxx.se/ja - ʢ೔ຊޠ 🎉ʣ

Slide 132

Slide 132 text

HTTP/3 現在 •IETF QUIC WGͰٞ࿦ → ͍Α͍Α RFC ΁

Slide 133

Slide 133 text

HTTP/3 現在 •IETF QUIC WGͰٞ࿦ → ͍Α͍Α RFC ΁ •ͦͯ͠…

Slide 134

Slide 134 text

HTTP/3 現在 •IETF QUIC WGͰٞ࿦ → ͍Α͍Α RFC ΁ •ͦͯ͠… •2021೥2݄18೔ 16:06 (UTC)

Slide 135

Slide 135 text

HTTP/3 現在 IUUQTNBJMBSDIJWFJFUGPSHBSDINTHJFUGBOOPVODFQWHCH,MX7'D-.1R-FJNC'[H

Slide 136

Slide 136 text

HTTP/3 現在 IUUQTNBJMBSDIJWFJFUGPSHBSDINTHJFUGBOOPVODFQWHCH,MX7'D-.1R-FJNC'[H

Slide 137

Slide 137 text

HTTP/3 現在 IETFʹঝೝ͞Ε·ͨ͠ 🎉🎉🎉🎉🎉

Slide 138

Slide 138 text

HTTP/3 現在 •IETF QUIC WGͰٞ࿦ → ͍Α͍Α RFC ΁ •HTTP/3 QUIC ঝೝ •RFC ൃߦ४උஈ֊ - ผͷHTTPηϚϯςΟΫε࢓༷ʹґଘ͍ͯ͠ΔͨΊ •࣮ͦͯ͠૷΁…

Slide 139

Slide 139 text

HTTP/3 Python •quicwg ͷ GithubϦϙδτϦ Wiki - Implementations

Slide 140

Slide 140 text

HTTP/3 Python •quicwg ͷ GithubϦϙδτϦ Wiki - Implementations •aioquic - QUIC implementation using Python and asyncio.

Slide 141

Slide 141 text

HTTP/3 Python •quicwg ͷ GithubϦϙδτϦ Wiki - Implementations •aioquic - QUIC implementation using Python and asyncio. •ASGI͸… HTTP/3 ʹؔͯ͠ͷϊʔλον

Slide 142

Slide 142 text

HTTP/3 Python •quicwg ͷ GithubϦϙδτϦ Wiki - Implementations •aioquic - QUIC implementation using Python and asyncio. •ASGI͸… HTTP/3 ʹؔͯ͠ͷϊʔλον ͕͔ͩ͠͠…

Slide 143

Slide 143 text

HTTP/3 Python •quicwg ͷ GithubϦϙδτϦ Wiki - Implementations •aioquic - QUIC implementation using Python and asyncio. •ASGI͸… HTTP/3 ʹؔͯ͠ͷϊʔλον ͕͔ͩ͠͠…

Slide 144

Slide 144 text

HTTP/3 Python •quicwg ͷ GithubϦϙδτϦ Wiki - Implementations •aioquic - QUIC implementation using Python and asyncio. •ASGI͸… HTTP/3 ʹؔͯ͠ͷϊʔλον ͕͔ͩ͠͠… Hypercorn can optionally serve the current draft of the HTTP/3 speci fi cation using the aioquic library.

Slide 145

Slide 145 text

Hypercorn aioquic •ಈ͔͢લʹͲ͏ಈ͍͍ͯͨΒਖ਼͍͠ͷ͔ h3spec

Slide 146

Slide 146 text

Hypercorn aioquic •ಈ͔͢લʹͲ͏ಈ͍͍ͯͨΒਖ਼͍͠ͷ͔ •http/2ʹ͸ h2spec ͱ͍͏πʔϧ͕͋Γ - moto ishizawa h3spec

Slide 147

Slide 147 text

Hypercorn aioquic •ಈ͔͢લʹͲ͏ಈ͍͍ͯͨΒਖ਼͍͠ͷ͔ •http/2ʹ͸ h2spec ͱ͍͏πʔϧ͕͋Γ - moto ishizawa h3spec •http/3ʹ͸ h3spec ͱ͍͏πʔϧ͕͋Γʂ

Slide 148

Slide 148 text

Hypercorn aioquic •ಈ͔͢લʹͲ͏ಈ͍͍ͯͨΒਖ਼͍͠ͷ͔ •http/2ʹ͸ h2spec ͱ͍͏πʔϧ͕͋Γ - moto ishizawa h3spec •http/3ʹ͸ h3spec ͱ͍͏πʔϧ͕͋Γʂ •h3spec Ͱద߹ੑΛνΣοΫʂ

Slide 149

Slide 149 text

Hypercorn aioquic •४උ 🍽 h3spec

Slide 150

Slide 150 text

Hypercorn aioquic •४උ 🍽 h3spec w1ZUIPO wQJQJOTUBMM`IZQFSDPSO` w44-ূ໌ॻ wTBNQMFBQQGBTUBQJlIFMMPXPSMEz wITQFD wDISPNJVN 🌽

Slide 151

Slide 151 text

Hypercorn aioquic •४උ 🍽 h3spec w1ZUIPO wQJQJOTUBMM`IZQFSDPSO` w44-ূ໌ॻ wTBNQMFBQQGBTUBQJlIFMMPXPSMEz wITQFD wDISPNJVN 🌽 ͍͍ͩͨ͜Μͳײ͡Ͱ͢ʢ֮͑ͳ͍͍ͯ͘Ͱ͢ʣ

Slide 152

Slide 152 text

Hypercorn aioquic Ͱ͸࣮ࡍʹಈ͔ͯ͠Έ·͠ΐ͏ h3spec w IZQFSDPSORVJDCJOEMPDBMIPTUDFSU fi MFDFSUQFNLFZ fi MF LFZQFNCJOEMPDBMIPTUTJNQMFGBTUBQJBQQ

Slide 153

Slide 153 text

Hypercorn aioquic Ͱ͸࣮ࡍʹಈ͔ͯ͠Έ·͠ΐ͏ h3spec w IZQFSDPSORVJDCJOEMPDBMIPTUDFSU fi MFDFSUQFNLFZ fi MF LFZQFNCJOEMPDBMIPTUTJNQMFGBTUBQJBQQ w ଓ͍ͯITQFDͰ͢

Slide 154

Slide 154 text

Hypercorn aioquic Ͱ͸࣮ࡍʹಈ͔ͯ͠Έ·͠ΐ͏ h3spec

Slide 155

Slide 155 text

Hypercorn aioquic Ͱ͸࣮ࡍʹಈ͔ͯ͠Έ·͠ΐ͏ h3spec w IZQFSDPSORVJDCJOEMPDBMIPTUDFSU fi MFDFSUQFNLFZ fi MF LFZQFNCJOEMPDBMIPTUTJNQMFGBTUBQJBQQ w ଓ͍ͯITQFDͰ͢ w ਅͬ੺Ͱͨ͠ʜ

Slide 156

Slide 156 text

Hypercorn aioquic Ͱ͸࣮ࡍʹಈ͔ͯ͠Έ·͠ΐ͏ h3spec w IZQFSDPSORVJDCJOEMPDBMIPTUDFSU fi MFDFSUQFNLFZ fi MF LFZQFNCJOEMPDBMIPTUTJNQMFGBTUBQJBQQ w ଓ͍ͯITQFDͰ͢ w ਅͬ੺Ͱͨ͠ʜ w )ZQFSDPSOͰ࢖༻͍ͯ͠ΔBJPRVJDͰ΋ಉ༷ʹਅͬ੺Ͱͨ͠

Slide 157

Slide 157 text

- HTTP/3 Python実装 現状 •Python HTTP/3͸͜Ε͔Βʂ

Slide 158

Slide 158 text

- HTTP/3 Python実装 現状 •Python HTTP/3͸͜Ε͔Βʂ •pythonͷasyncioʹ͸τϥϯεϙʔτ૚ʢUDP΋ʣΛѻ͏API͕༻ҙ͞Ε͍ͯΔ

Slide 159

Slide 159 text

- HTTP/3 Python実装 現状 •Python HTTP/3͸͜Ε͔Βʂ •pythonͷasyncioʹ͸τϥϯεϙʔτ૚ʢUDP΋ʣΛѻ͏API͕༻ҙ͞Ε͍ͯΔ •ASGIͰ͸HTTP/3 QUICͰ͸ٞ࿦͸࢝·͍ͬͯ·ͤΜ͕ɺ

Slide 160

Slide 160 text

- HTTP/3 Python実装 現状 •Python HTTP/3͸͜Ε͔Βʂ •pythonͷasyncioʹ͸τϥϯεϙʔτ૚ʢUDP΋ʣΛѻ͏API͕༻ҙ͞Ε͍ͯΔ •HTTP/3 QUICͱasyncioͰASGIΛ͞ΒʹҰาઌ΁ •ASGIͰ͸HTTP/3 QUICͰ͸ٞ࿦͸࢝·͍ͬͯ·ͤΜ͕ɺ

Slide 161

Slide 161 text

- HTTP/3 Python実装 現状 •Python HTTP/3͸͜Ε͔Βʂ •pythonͷasyncioʹ͸τϥϯεϙʔτ૚ʢUDP΋ʣΛѻ͏API͕༻ҙ͞Ε͍ͯΔ •HTTP/3 QUICͱasyncioͰASGIΛ͞ΒʹҰาઌ΁ •ASGIͰ͸HTTP/3 QUICͰ͸ٞ࿦͸࢝·͍ͬͯ·ͤΜ͕ɺ •·ͣ͸Ұาͣͭ

Slide 162

Slide 162 text

- HTTP/3 Python実装 現状 •Python HTTP/3͸͜Ε͔Βʂ •pythonͷasyncioʹ͸τϥϯεϙʔτ૚ʢUDP΋ʣΛѻ͏API͕༻ҙ͞Ε͍ͯΔ •Hypercorn΋aioquic΋։ൃ͸׆ൃ •HTTP/3 QUICͱasyncioͰASGIΛ͞ΒʹҰาઌ΁ •ASGIͰ͸HTTP/3 QUICͰ͸ٞ࿦͸࢝·͍ͬͯ·ͤΜ͕ɺ •·ͣ͸Ұาͣͭ

Slide 163

Slide 163 text

- HTTP/3 Python実装 現状 •Python HTTP/3͸͜Ε͔Βʂ •pythonͷasyncioʹ͸τϥϯεϙʔτ૚ʢUDP΋ʣΛѻ͏API͕༻ҙ͞Ε͍ͯΔ •Hypercorn΋aioquic΋։ൃ͸׆ൃ •HTTP/3 QUICͱasyncioͰASGIΛ͞ΒʹҰาઌ΁ •ASGIͰ͸HTTP/3 QUICͰ͸ٞ࿦͸࢝·͍ͬͯ·ͤΜ͕ɺ •·ͣ͸Ұาͣͭ •ΠγϡʔΛͷ͍ͧͯΈΔͱ͜Ζ͔Β͸͡ΊͯΈͯ͸ 👀

Slide 164

Slide 164 text

- HTTP/3 Python実装 現状 •Python HTTP/3͸͜Ε͔Βʂ •pythonͷasyncioʹ͸τϥϯεϙʔτ૚ʢUDP΋ʣΛѻ͏API͕༻ҙ͞Ε͍ͯΔ •Hypercorn΋aioquic΋։ൃ͸׆ൃ •HTTP/3 QUICͱasyncioͰASGIΛ͞ΒʹҰาઌ΁ •ASGIͰ͸HTTP/3 QUICͰ͸ٞ࿦͸࢝·͍ͬͯ·ͤΜ͕ɺ •·ͣ͸Ұาͣͭ •ΠγϡʔΛͷ͍ͧͯΈΔͱ͜Ζ͔Β͸͡ΊͯΈͯ͸ 👀 •Hypercornͷissueʹίϝϯτͯ͠Έ·ͨ͠

Slide 165

Slide 165 text

参考資料 •HTTP/3 explained IUUQTIUUQFYQMBJOFEIBYYTFKB •Fastly : Making the Web faster with HTTP/3 - kazuho oku 8FCΛՃ଎͢Δ)551 •http3-note IUUQTHJUIVCDPN fl BOPZVLJIUUQOPUF •Playing with QUIC - The Chromium Projects IUUQTXXXDISPNJVNPSHRVJDQMBZJOHXJUIRVJD