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

ライブストリーミングサービスの負荷を捌くためにしたNのこと

 ライブストリーミングサービスの負荷を捌くためにしたNのこと

YAPC::Asia Hachioji 2016 mid in Shinagawaで発表した資料

100f944949861b8c4be7ba349820fb7a?s=128

Keigo AOKI

July 03, 2016
Tweet

More Decks by Keigo AOKI

Other Decks in Technology

Transcript

  1. Concert crowd with stage lights | CC-BY: Vector Open Stock

    https://www.vectoropenstock.com/vectors/preview/69124/concert-crowd-with-stage-lights ϥΠϒετϦʔϛϯάαʔϏεͷ ෛՙΛࡹͨ͘Ίʹͨ͠Nͷ͜ͱ ੨໦ ܒ߶ @hoyo1111 n = 3
  2. @hoyo1111  ੨໦ܒ߶ʢ͓͖͚͍͋͝͏ʣ  גࣜձࣾѮɹɹɹɹࣥߦ໾һ$50ɹˡࠓ೔͸ͬͪ͜ͷ࿩  גࣜձࣾϗϤελɹ୅දऔక໾  1)1FSͰ͢ 

    ओʹ1IBMDPOͱ͍͏ϑϨʔϜϫʔΫΛ࢖͍ͬͯ·͢  ΋ͱ΋ͱӦۀ΍ͬͯ·ͨ͠ʢ໿೥ʣ  ΤϯδχΞͱͯ͠ͷ࣮຿ܦݧ͸Ѯ͕ࣾ໨Ͱ͢
  3. ࠓ೔࿩͢͜ͱ  ΤϯδχΞܦݧθϩͷਓ͕ؒελʔτΞοϓʹδϣΠϯͯ͠ɺ ؾ߹ͱࠜੑͰαʔϏεΛܧଓ͖ͤͯͨ͞Τϐιʔυ  αʔϏεͷεέʔϧʹؔ͢Δͻͱͭͷࣄྫ  ΠϯϑϥͷεέʔϧΛߟ͑Δͱ͖ʹ৺͕͚͍ͯΔ͜ͱ

  4. Concert crowd with stage lights | CC-BY: Vector Open Stock

    https://www.vectoropenstock.com/vectors/preview/69124/concert-crowd-with-stage-lights ϥΠϒετϦʔϛϯά
  5. Concert crowd with stage lights | CC-BY: Vector Open Stock

    https://www.vectoropenstock.com/vectors/preview/69124/concert-crowd-with-stage-lights
  6. None
  7. Concert crowd with stage lights | CC-BY: Vector Open Stock

    https://www.vectoropenstock.com/vectors/preview/69124/concert-crowd-with-stage-lights ഭΓདྷΔόʔεττϥϑΟοΫ
  8. ϥΠϒετϦʔϛϯάத

  9. ࢹௌऀ͕૿͑ͳ͍Α͏ʹ ϓογϡ௨஌Λ͖͋ΒΊΔ҉ࠇظ n = 1 ʢ2೥લ͘Β͍ʣ

  10. ଓ͚ͯݟΔϢʔβ΋͍ΔͷͰ 19࣌୆ΑΓ΋20࣌୆ɺ 20࣌୆ΑΓ΋21࣌୆ͷ΄͏͕ ΞΫηε͕૿͑Δ͜ͱ͕ଟ͍ तۀ5ʙ10෼લʹϓογϡ௨஌Λૹ͍͕ͬͯͨɺ ෛՙ͕ߴ͍ͷͱ͖͸҆ఆੑΛ༏ઌ͠ٽ͘ٽ͖͋͘ΒΊΔ͜ͱ΋…

  11. ΞΫηε૿΁ͷରࡦ͕΄΅օແͰ ίϝϯτऔಘͷͨΊͷϙʔϦϯάͰ αʔόͷෛՙ͕૿େ͠ଓ͚Δ ʂ ΋ ͏ݶք ʂ

  12. $BDIJOH-PBE#BMBODJOH

  13. ElastiCache(Memcached)Λ࢖͍ ίϝϯτऔಘͳͲҰ෦ʹ͍ͭͯ HTTPϦΫΤετ݁ՌΛΩϟογϡ ʂ

  14. Ξοϓϩʔυͨ͠ը૾ͳͲ͸ ֨ೲઌΛS3ʹมߋ ʂ ηογϣϯ৘ใͷอଘઌ΋ Memcacheʹมߋ ELBΛಋೖ

  15. n = 2 ഑৴͕ελʔτ͢ΔλΠϛϯά͚ͩ ҟৗͳ΄Ͳ൓Ԡ͕஗͘ͳΔ֦େظ ʢ൒೥લ͘Β͍ʣ

  16. ΞϓϦىಈ࣌ʹΫΤϦ͕ଟ਺࣮ߦ - Ϣʔβೝূ / ձһεςʔλε֬ೝ - ഑৴εέδϡʔϧදࣔ - ΞϓϦ಺௨஌ͷ༗ແ֬ೝɹͳͲ ʂ

    ΋ ͏ݶք ʂ
  17. "NB[PO"VSPSB

  18. ʂ RDSͷΤϯδϯΛAurora΁มߋ ߋ৽ܥΫΤϦͷΈwriterʹ޲͚Δ ࢀরܥΫΤϦ͸read replica΁

  19. nginx php-fpm haproxy writer read replica read replica

  20. n = 3 ৔౰ͨΓతͩͬͨϩάऩू͕ αʔϏεͷ੒௕Λ્֐͢Δస׵ظ ʢ΄΅ݱࡏਐߦܗʣ

  21. ϥΠϒετϦʔϛϯάࢹௌϢʔβͷ ΞΫηεϩάΛMySQLʹอଘ ࢹௌ։࢝ˠ཭୤Λ೺Ѳ͍ͨͨ͠Ί ϙʔϦϯάͷ౎౓DBʹΫΤϦ͕૸Δ ΋ ͏ݶք ʂ

  22. 4FSWFSMFTT"SDIJUFDUVSF

  23. ϩάͷҰ࣌อଘઌΛ DynamoDBʹมߋ͠ɺ طଘͷAPI Server͔Β LambdaʹॲཧΛҕৡ

  24. ϩάͷҰ࣌อଘઌΛ DynamoDBʹมߋ͠ɺ طଘͷAPI Server͔Β LambdaʹॲཧΛҕৡ ഑৴ऴྃޙʹWorker͕ DynamoDBͷϨίʔυΛ ద੾ʹ੔ܗ͔ͯ͠Βอଘ

  25. Concert crowd with stage lights | CC-BY: Vector Open Stock

    https://www.vectoropenstock.com/vectors/preview/69124/concert-crowd-with-stage-lights େ੾ʹ͖ͯͨ͜͠ͱ
  26. Concert crowd with stage lights | CC-BY: Vector Open Stock

    https://www.vectoropenstock.com/vectors/preview/69124/concert-crowd-with-stage-lights #VJMEUP5IJOL
  27. ૸Γͳ͕Βߟ͑Δ  ձࣾ΍αʔϏεͷϑΣʔζʹΑͬͯબ୒ࢶ͸ແݶେ  ࣍ʑͱ৽͍ٕ͠ज़͕ग़ͯ͘ΔͷͰ࠷దղ͸ৗʹมԽ͢Δ  ͦ΋ͦ΋ɺεέʔϧͷ֦େΑΓ༏ઌ͢΂͖͜ͱ͕͍͍ͩͨଟ͍

  28. Concert crowd with stage lights | CC-BY: Vector Open Stock

    https://www.vectoropenstock.com/vectors/preview/69124/concert-crowd-with-stage-lights OBOJHJHBOUVNVNFSJTJOTJEFOUFT
  29. ڊਓͷݞʹͷΔ  ୳ͤ͹ࢁͷΑ͏ʹέʔεελσΟ͕ग़ͯ͘Δ  શͯΛθϩ͔Β͍ͭͬͯ͘Δ༨༟͸ͳ͍  ελʔτΞοϓʹͱͬͯ͸ɺ࠷ઌ୺ͷҰา͋ͱΛาΉ͘Β͍͕ ͪΐ͏Ͳ͍͍ʢ৔߹΋ଟ͍ʣ  ٕज़ͷ૊Έ߹Θͤ࣍ୈͰʢ͋Δఔ౓·Ͱ͸ʣͳΜͱ͔ͳΔ

  30. Concert crowd with stage lights | CC-BY: Vector Open Stock

    https://www.vectoropenstock.com/vectors/preview/69124/concert-crowd-with-stage-lights 8FSF)JSJOH