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

ライブ視聴を支える配信基盤の話をざっくりと / livestreaming-dogenzak...

Taro Hirose
October 19, 2016

ライブ視聴を支える配信基盤の話をざっくりと / livestreaming-dogenzakabeerbash

道玄坂BeerBash#2 秋のLT収穫祭
「ライブ視聴を支える配信基盤の話をざっくりと」
http://dogenzaka-beerbash.connpass.com/event/39352/

Taro Hirose

October 19, 2016
Tweet

More Decks by Taro Hirose

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ ኍ੉ ଠ࿠ @ CyberZ ▸ OPENRECࣄۀ෦ ▸ Πϯϑϥ &

    αʔόαΠυΤϯδχΞ ▸ લ৬: IT Consulting Firm / SIer ▸ ಘҙྖҬ: ߏ੒؅ཧ/ࣗಈԽ, ؂ࢹ ▸ Twitter: @uorat ▸ Blog: http://uorat.hatenablog.com/
  2. ϥΠϒ഑৴ͷجຊ HLS (HTTP Live Streaming) ▸ AppleʹΑΓ։ൃ͞ΕͨHTTP ϕʔεͷετϦʔϛϯάϓϩτ ίϧ ▸

    ಈըσʔλΛ਺ඵʙॏ਺ඵͷϑΝ Πϧʹ෼ׂ͠ஞ࣍Download͠ ͯ࠶ੜ͢Δ ▸ HTTPͷԸܙΛڗडͰ͖Δ ▸ ಛघͳPlayerෆཁ ▸ Caching͠΍͍͢ ▸ Scaling͠΍͍͢
  3. ͏ͪͷετϦʔϛϯάᶃ ϙΠϯτ: ʮ͋͑ͯʯAWSʹ࠷దԽ ▸ CloudFrontʹΑΔHLS഑৴ͷলΤωԽ ▸ CacheઓུʹΑΔOriginαʔόͷෛՙݮ ▸ EC2 +

    CloudFrontͷ૊Έ߹ΘͤʹΑΔԸܙ ▸ CDN Edge - OriginؒͷLatency࠷খԽ ▸ Origin → CDN Edgeؒͷσʔλసૹૹ৴ྉ Free ▸ GPUΠϯελϯεͷ׆༻ ▸ EC2 API ʹΑΔෛՙʹԠ֦ͨ͡ுॖୀ੍ޚ
  4. νϟοτͷجຊ ۭؒڞ༗ ▸ ؍ઓ࣌ͷྟ৔ײΛΦϯϥΠϯͰମݧ ▸ ྫ: RAGE ▸ ίϛϡχέʔγϣϯखஈ ▸

    ϓϨΠϠʔɿࢹௌऀ ▸ ࢹௌऀɿࢹௌऀ ▸ ྫ: ϚΠϯΫϥϑτ ग़య: http://tappli.org/column-detail.php?id=1166
  5. νϟοτͷجຊ ϦΞϧλΠϜϝοηʔδ഑৴ج൫ ▸ ϦΞϧλΠϜ ▸ ஗Ԇ = e-sportsಛ༗ͷྟ৔ײΛڞ༗Ͱ͖ͳ͍ ▸ ഑৴ऀɿࢹௌऀؒͷର࿩खஈͰ΋͋Δ

    ▸ શࢹௌऀʹରͯ͠Ұ੪ʹϝοηʔδ഑৴͢Δඞཁ͋Γ ▸ ߴ֦ுੑ ▸ ಉ࣌ࢹௌऀ਺͕૿͑ͯ΋εέʔϧΞ΢τͰ͖Δ ▸ ਓؾ഑৴͸਺ສਓҎ্ͷϢʔβ͕ࢹௌ͢Δ ▸ ෳ਺഑৴͋Γɺ഑৴͸໷ʹूத͢Δ ▸ ࢹௌऀ͕਺ेສ, ਺ඦສਓͱ૿͑ͯ΋ϝοηʔδ഑৴ʹࢧো Λ͖ͨ͞ͳ͍͜ͱ
  6. ࠓ 2िؒͰ࡞ͬͨνϟοτج൫ ▸ Node.js + Socket.IOϕʔεͷ WebSocketΞϓϦέʔγϣϯ ▸ MessageHubʹRedis (Pub/Sub)

    ▸ ELB(Classic) ͕WebSocketඇରԠͷ ͨΊɺΞϓϦέʔγϣϯଆͰόϥϯ γϯάॲཧ࣮૷
  7. ࠓ 2िؒͰ࡞ͬͨνϟοτج൫ ▸ Node.js + Socket.IOϕʔεͷ WebSocketΞϓϦέʔγϣϯ ▸ MessageHubʹRedis (Pub/Sub)

    ▸ ELB(Classic) ͕WebSocketඇରԠͷ ͨΊɺΞϓϦέʔγϣϯଆͰόϥϯ γϯάॲཧ࣮૷
  8. ͏ͪͷετϦʔϛϯάᶄ ઈࢍϦϓϨʔεத ▸ WebSocketରԠͨ͠ELB - ALBΛಋೖ ▸ ϑϧϚωʔδυʹΑΔӡ༻ෛՙݮΛૂ͏ ▸ Nginx

    + SerfͰ΋ྑ͍Μ͚ͩͲ ▸ Content-Based RoutingΛ׆༻ͨ͠खܰͳγϟʔσΟϯά ▸ ͦͷଞॾʑͷϝεೖΕ ▸ Node.js / Socket.IO version up ▸ AutoScaling
  9. ·ͱΊ ϓϥοτϑΥʔϜ࠷దԽ ≠ ϩοΫΠϯ ▸ ʮ͋͑ͯʯͦ͜ʹ࠷దԽ͢Δ͜ͱͰੜ·ΕΔϝϦοτ΋͋Δ ▸ අ༻ ▸ ӡ༻༰қੑ

    ▸ ϨΠςϯγ ▸ γϯϓϧ ▸ దࡐదॴͳٕज़࠾୒ͱઃܭ େࣄ ▸ ϑϧϚωʔδυ or ࣗྗ࣮૷ ▸ େࣄͳ͜ͱ͸ Ϗδωε໨ඪΛୡ੒͢ΔͨΊͷಓےΛඳ͘͜ͱ ▸ εϐʔυ ▸ ίετ
  10. ࠂ஌ RAGE vol.3 Shadowverse ▸ ༧બ: 2016/10/22 (౔) - 10/23

    (೔) ▸ ܾউ (GRAND FINAL): 2016/11/23 (ਫɾॕ) https://rage-esports.jp/