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

HTTP/2とmrubyの活用

 HTTP/2とmrubyの活用

HTTP/2時代のサーバ設定になぜmrubyが必要か

MATSUMOTO Ryosuke

February 05, 2016
Tweet

More Decks by MATSUMOTO Ryosuke

Other Decks in Technology

Transcript

  1. )551ͷ໰୊  ଟॏੑ͕ແ͍  355ʢ3PVOE5SJQ5JNFʣʹ͖ͭSFRVFTUSFTQPOTF  )P- )FBEPG-JOF #MPDLJOH 

    )551ύΠϓϥΠϯͷ࣮༻Խ͕ࠔ೉  355ͰϨεϙϯεΛ଴ͨͣʹෳ਺ϦΫΤετૹ৴  ϦΫΤετͱϨεϙϯεͷॱং͸ಉظ͢Δඞཁ༗Γ  ͱ͋ΔϦΫΤετॲཧ͕஗͍ͱ݁ہޙଓ͕ϒϩοΫ  ϦΫΤετͷ࠶ૹ৴ʢಛʹ1045ͱ͔ʣͷ൑அ͕ࠔ೉  όά΋ଟ͘ඇඪ४ͷΦϓγϣϯѻ͍͕ଟ͍ 
  2. )551ʢ3'$ʣ  355Ͱޮ཰ྑ͘σʔλΛ௨৴  ௨৴σʔλ͸ʮϑϨʔϜʯΛར༻  ετϦʔϜ্ʹϑϨʔϜ͕ྲྀΕΔ  ϑϨʔϜͷαΠζ΍਺ͰετϦʔϜϕʔεͷϑϩʔ੍ޚՄೳ 

    ୯Ұ5$1ηογϣϯ্ʹଟॏͷʮετϦʔϜʯ  ಉ࣌ʹҎ্ͷϦΫΤετʢϑϨʔϜʣΛૹ৴Մೳ  ଟॏԽʹΑͬͯϨΠςϯγͷӨڹΛ௿ݮ  ϦΫΤετॲཧ͕ϒϩοΫ͞Εͳ͍ͷͰଟॏԽʹΑΓଳҬΛ ޮ཰తʹ࢖͍΍͘͢ͳΔ 
  3. ୅දతͳ)551αʔό  )0  !LB[VIP͞Μ࡞ͷ5IF0QUJNJ[FE)551BOE)5514FSWFS  OHIUUQYʢͦͷଞϥΠϒϥϦɾπʔϧ܈Λ·ͱΊͯOHIUUQʣ  !UBUTVIJSP@U͞Μ࡞ͷ)551ϦϑΝϨϯε࣮૷ɺαʔό΍ϥΠϒϥϦ 

    όοΫΤϯυͱ)551௨৴͕Մೳʢݱঢ়͸།Ұʁʣ  "QBDIFIUUQEW  MJCOHIUUQΛར༻  OHJOYW  044൛ͱͯ͠ϦϦʔε  5SVTUFSE)5514FSWFS  !NBUTVNPUPSZ࡞Ͱ୅දతͰ͸ແ͍ɺMJCOHIUUQΛར༻  શͯNSVCZʹΑΔ੍ޚػೳΛ͍࣋ͬͯΔ 
  4. ୔ࢁ͋ΔͷͰ͕͢ʜ  ຊൃදͰ͸NSVCZʹؔ࿈ͷڧ͍ҎԼͷͭʹݴٴ  4FSWFS1VTI  ༏ઌ౓੍ޚ  ࡉ͔͍ॴ͸3'$ΛಡΉͷ͕Ұ൪Ͱ͢ 

    ୔ࢁಛ௃͕͋ΔͷͰৄ͘͠͸ԼهεϥΠυࢀߟ  !LB[VIP͞Μͷʮ)551࣌୅ͷ΢ΣϒαΠτઃܭʯ  IUUQZBQDBTJBPSHUBMLTIPXEFBECFBEDEDB  !+YDL͞Μͷʮ)551࣌୅ͷ8FCʯ  IUUQZBQDBTJBPSHUBMLTIPXFBFGCFBBCEDB 
  5. όοΫΤϯυ)551͕αʔόϓογϡ  ϑϩϯτ)551αʔόʹ-JOLϔομͰαʔόϓογϡΛґཔ  ϑϩϯτଆͰόοΫΤϯυ΁ͷసૹલʹ௚઀αʔόϓογϡ΋Մೳ ΫϥΠΞϯτ )551 ϦόʔεϓϩΩγ )551 όοΫΤϯυ

    )551௨৴ )551௨৴ -JOLϔομ௥Ճ -JOLJOEFYKTSFMQSFMPBE ϦΫΤετసૹ JOEFYUYUΛϦΫΤετ Ϩεϙϯεసૹ JOEFYKTΛαʔόϓογϡ JOEFYUYUΛ Ϩεϙϯε 
  6. όοΫΤϯυ)551͕αʔόϓογϡ  ݱঢ়͸OHIUUQYͷΈ͕όοΫΤϯυͱͷ)551௨৴ʹରԠ  ݱঢ়͸)551Ͱ΋όοΫΤϯυ͔Βͷ-JOLϔομΛར༻ͨ͠αʔόϓογϡ  ࠓޙόοΫΤϯυ͔Βͷ164)@130.*4&Λసૹ͢ΔՄೳੑ΋͋Δʁ  ϗοϓؒͷ4&55*/(4ΛͲ͏͢Δ͔౳՝୊͸৭ʑ͋Δ ΫϥΠΞϯτ

    )551 ϦόʔεϓϩΩγ OHIUUQY )551 όοΫΤϯυ )551௨৴ )551௨৴ -JOLϔομ௥Ճ -JOLJOEFYKTSFMQSFMPBE ϦΫΤετసૹ JOEFYUYUΛϦΫΤετ Ϩεϙϯεసૹ JOEFYKTΛαʔόϓογϡ JOEFYUYUΛ Ϩεϙϯε 
  7. OHIUUQYͱUSVTUFSE  USVTUFSE͸αʔόϓογϡະରԠ͕ͩOHIUUQYͱ૊Έ߹ΘͤΒΕΔ  OHIUUQYΛϑϩϯτʹஔ͍ͯόοΫΤϯυUSVTUFSE  ΫϥΠΞϯτ͔Βͷ)551Yͱ)551྆ରԠ  αʔόϓογϡՄೳʹͳΓόοΫΤϯυͰϓϩάϥϚϒϧͳಈ͖ΛNSVCZͰఆٛͰ͖Δ 

    ը૾ม׵αʔόྫIUUQICNBUTVNPUPSKQFOUSZ ΫϥΠΞϯτ )551·ͨ͸ )551 ϦόʔεϓϩΩγ OHIUUQY )551 όοΫΤϯυ USVTUFSE )551·ͨ͸)551Yͷ5-4௨৴ )551ͷฏจ௨৴ -JOLϔομ௥Ճ -JOLJOEFYKTSFMQSFMPBE ϦΫΤετసૹ NSVCZEZOBNJDΛϦΫΤετ Ϩεϙϯεసૹ JOEFYKTΛαʔόϓογϡ NSVCZ@EZOBNJDΛ Ϩεϙϯε 
  8. αʔόϓογϡͷ՝୊ͱ޻෉  ΫϥΠΞϯτͷϒϥ΢βΩϟογϡΛͲ͏͢Δ͔  ϒϥ΢βͷΩϟογϡΛαʔόଆͰݕ஌Ͱ͖ͳ͍  ݕ஌ͷͨΊʹ࠶ϦΫΤετ͢Δͱαʔόϓογϡͷ355ΛՔ͙ҙຯ͕ແ͍  )0Ͱ͸DBDIFBXBSFTFSWFSQVTI $"$)&@%*(&45

      ઐ༻ͷϑϨʔϜ ࠓ͸$PPLJFϔομʣͰΩϟογϡͷ৘ใΛ૬ޓʹ؅ཧ  ΫϥΠΞϯτɾαʔό྆ํͰͷରԠ͕ඞཁ  !LB[VIP͞ΜʹΑͬͯυϥϑτԽ  IUUQTUPPMTJFUGPSHIUNMESBGULB[VIPIDBDIFEJHFTU  NSVCZͰαʔόϓογϡΛ੍ޚ͍ͨ͠ 
  9. ༏ઌ౓੍ޚ  جຊతʹΫϥΠΞϯτ͕ίϯςϯπͷ༏ઌ౓Λࢦఆ  ॏΈ෇͚ʢଳҬʣͱґଘؔ܎ʢઌʹ༏ઌͯ͠഑৴͢Δ͔ʣ  KT΍ DTTΛ༏ઌతʹड৴͢Δ͜ͱͰϒϥ΢βͰͷ ϑΝʔετϖΠϯτʹ൐͏ମײ଎౓͕޲্ 

    ࢖͍ͬͯͳ͍λϒ͕࣋ͭετϦʔϜ͸༏ઌ౓Լ͛Δͱ͔  ΞΫςΟϒʹͳͬͨλϒͷ༏ઌ౓Λ্͛Δͱ͔  ϒϥ΢β࣮૷ʹΑͬͯ͸ମײ͕஗͘ͳΔ৔߹΋͋Δ 
  10. NSVCZJO)551TFSWFS )551αʔόʹର͢Δ͜Ε·Ͱͷ࣮૷ྫ  NPE@NSVCZ  "QBDIFIUUQEΛNSVCZͰ੍ޚ͢ΔϞδϡʔϧ  OHY@NSVCZ  OHJOYΛNSVCZͰ੍ޚ͢ΔϞδϡʔϧ

    ࠷ۙͰ͸  )0΍OHIUUQY΋NSVCZʹΑΔ੍ޚΛαϙʔτ  )551ͷෳࡶͳಈ࡞Λޮ཰ྑ͘ઃఆ͢Δͷʹ૬ੑ͕ྑ͍
  11. ࣮૷໘ͰؾΛ͚͍ͭͯΔࣄ  ϋΠύϑΥʔϚϯε  ΦʔόʔϔουʹͳΓʹ͍͘  ϝϞϦ͕୯ௐ૿Ճ͠ͳ͍Α͏ʹ͢Δ  ֶशίετΛݮΒ͢ 

    γϯϓϧͳΫϥεͱϝιουɾ౷Ұ࢓༷  ػೳ֦ு͸Ͱ͖Δ͚ͩNSCHFN˞ ˞$3VCZͷHFNʹ͋ͨΔNSVCZͷϞδϡʔϧ 
  12. ϋΠύϑΥʔϚϯε  NSVCZΛ࠾༻ͯ͠ੑೳ໘ͱੜ࢈ੑΛཱ྆  +*4ن֨ʹ४ڌͨ͠࢓༷ʹΑΓܰྔ  ࣄલʹόΠτίʔυʹ͓ͯ͘͠ͱߴ଎ʹಈ࡞  3VCZίʔυͷෳ਺ճ࣮ߦͰ͸ܰྔͳΠϯλ ϓϦλ͕଎౓ʹ΋ޮ͍ͯ͘Δ

     ৄ͘͠͸࿦จͰ˞ ˞দຊ྄հɾԬ෦णஉ NPE@NSVCZɿεΫϦϓτݴޠͰߴ଎͔ͭলϝϞϦʹ֦ுՄೳͳ8FCαʔόͷػೳ֦ ுࢧԉػߏ ৘ใॲཧֶձ࿦จࢽ 7PM /P QQ ೥݄
  13. NSVCZNFFUT)551  NSVCZ૊ࠐΈͷ)5514FSWFS͕ଓʑొ৔  )0ɺOHIUUQYɺ5SVTUFSE  "QBDIF΍OHJOYͷ)551αϙʔτ  NPE@NSVCZ΍OHY@NSVCZͰطʹ੍ޚՄೳ 

    ࠓޙαʔόϓογϡͷNSVCZԽʹ΋ରԠ༧ఆ  ͍ͭʹNSVCZJO)5514FSWFSͷ࣌୅͕དྷΔʁ  NPE@NSVCZ΍OHY@NSVCZ։ൃऀͱͯ͠ײ֒ਂ͍ 
  14. ಉظݺग़ͷඇಉظԽ  NSVCZJOIUUQEͷ՝୊  %#ΞΫηεͱ͍ͬͨಉظॲཧͰΠϕϯτϧʔ ϓ͍ͯ͠ΔIUUQEଆͷॲཧ͕ϒϩοΫ  ໰͍߹Θ͕ͤൃੜͨ͠ޙʹIUUQEʹॲཧΛ໭͢  ·ͩΞΠσΞϕʔεͳͷͰࠓޙٞ࿦

     SFGNSVCZͰಉظݺग़ΛඇಉظԽ͢Δ࿩ʢ΋͘͠͸)0ͷNSVCZϋϯυϥͰωοτϫʔΫΞΫηε͢Δ࿩ʣ IUUQCMPHLB[VIPPLVDPNNSVCZIUNM
  15. 5$1-BZFSXJUINSVCZ  5$1-PBE#BMBODJOHXJUINSVCZ  OHJOYͷTUSFBNϞδϡʔϧΛ֦ு  IUUQICNBUTVNPUPSKQFOUSZ  ׆༻ྫ 

    'MVFOUEͷ5$1ύέοτΛόοΫΤϯυʹసૹ  ࡞੒ͨ͠άϥϑ͸ಉ༷ʹOHJOYͰϦόʔεϓϩΩγ  ؅ཧσʔλ͸5$1΋)551΋Ұݩ؅ཧ  IUUQICNBUTVNPUPSKQFOUSZ
  16. 5IF)VHF/VNCFSPG4FSWFST 'MVFOUE /PSJLSB (SPXUI'PSFDBTU 'MVFOUE /PSJLSB (SPXUI'PSFDBTU 'MVFOUE /PSJLSB (SPXUI'PSFDBTU

    )551$MJFOU 'MVFOUE 'MVFOUE OHY@NSVCZ 5$1-PBE#BMBODFS )5513FWFSTF1SPYZ 5$1 )551 4DBMFPVU
  17. ಈతূ໌ॻಡΈࠐΈ  5-4͕౰ͨΓલͷIPTU૿େʹ൐͏ઃఆͷ൥ࡶԽ  OHY@NSVCZʹΑΔಈతূ໌ॻಡΈࠐΈ  ηογϣϯ୯ҐͰূ໌ॻಡΈࠐΉ࣌ʹNSVCZΛϑοΫ  PQFOTTMҎ্͕ඞཁ 

    4/*ͷTFSWFSOBNFʹ߹கͨ͠ূ໌ॻϑΝΠϧΛಡΈࠐΉ  ઃఆ͕ҰͭͰࡁΉ͠ϝϞϦ΋ݮΔ  ੑೳ͸OHY@NSVCZͷIFMMPXPSMEϕϯνͰݮఔ౓
  18. NSVCZJO)5514FSWFS  )0΍OHIUUQYΛNSVCZͰ੍ޚͯ͠)551ʢαʔόϓογϡ ౳ʣΛମݧͯ͠Έ·͠ΐ͏  5SVTUFSE΋๨Εͳ͍Ͱ͋͛ͯԼ͍͞  ͦͷ্Ͱ)551ͱ)551ͷαʔό࿈ܞΛNPE@NSVCZ΍ OHY@NSVCZͱ૊Έ߹Θͤͯઃܭͯ͠Έ·͠ΐ͏ 

    NSVCZͰ੍ޚग़དྷΔ͜ͱͷརศੑ͕ମײͰ͖Δ͔΋͠Ε·ͤΜ  ૝૾Ͱ͖ͳ͔ͬͨΑ͏ͳߴ౓ͳ࿈ܞΛࢥ͍͔ͭ͘΋͠Ε·ͤΜ  NSVCZJO)551TFSWFSΛ࢖ͬͯΑΓߴ౓ͳ8FCγεςϜΛ։ ൃ͍͖ͯ͠·͠ΐ͏ʂ