Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
大規模ライブ配信の苦労ポイント
Search
gree_tech
PRO
April 19, 2019
Technology
0
440
大規模ライブ配信の苦労ポイント
「Kubernetes Meetuo Tokyo #13」で発表された資料です。
https://k8sjp.connpass.com/event/100842/
gree_tech
PRO
April 19, 2019
Tweet
Share
More Decks by gree_tech
See All by gree_tech
変わるもの、変わらないもの :OSSアーキテクチャで実現する持続可能なシステム
gree_tech
PRO
0
3.5k
マネジメントに役立つ Google Cloud
gree_tech
PRO
0
41
今この時代に技術とどう向き合うべきか
gree_tech
PRO
3
2.5k
生成AIを開発組織にインストールするために: REALITYにおけるガバナンス・技術・文化へのアプローチ
gree_tech
PRO
0
270
安く・手軽に・現場発 既存資産を生かすSlack×AI検索Botの作り方
gree_tech
PRO
0
260
生成AIを安心して活用するために──「情報セキュリティガイドライン」策定とポイント
gree_tech
PRO
1
1.6k
あうもんと学ぶGenAIOps
gree_tech
PRO
0
380
MVP開発における生成AIの活用と導入事例
gree_tech
PRO
0
410
機械学習・生成AIが拓く事業価値創出の最前線
gree_tech
PRO
0
280
Other Decks in Technology
See All in Technology
大規模な組織におけるAI Agent活用の促進と課題
lycorptech_jp
PRO
6
7.8k
LINE Messengerの次世代ストレージ選定
lycorptech_jp
PRO
19
7.4k
vLLM Community Meetup Tokyo #3 オープニングトーク
jpishikawa
0
110
Secure Boot 2026 - Aggiornamento dei certificati UEFI e piano di adozione in azienda
memiug
0
140
Agentic Software Modernization - Back to the Roots (Zürich Agentic Coding and Architectures, März 2026)
feststelltaste
1
170
Introduction to Bill One Development Engineer
sansan33
PRO
0
380
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.4k
20260305_【白金鉱業】分析者が地理情報を武器にするための軽量なアドホック分析環境
yucho147
1
170
生成AIの利用とセキュリティ /gen-ai-and-security
mizutani
1
1.2k
メタデータ同期に潜んでいた問題 〜 Cache Stampede 時の Cycle Wait を⾒つけた話
lycorptech_jp
PRO
0
150
GitLab Duo Agent Platform + Local LLMサービングで幸せになりたい
jyoshise
0
110
LY Tableauでの Tableau x AIの実践 (at Tableau Now! - 2026-02-26)
yoshitakaarakawa
0
1.3k
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
130
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
260
Test your architecture with Archunit
thirion
1
2.2k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
470
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
210
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
79
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
SEO for Brand Visibility & Recognition
aleyda
0
4.3k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
430
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
How to Talk to Developers About Accessibility
jct
2
140
Transcript
⼤規模ライブ配信 の苦労ポイント
• 堀⼝真司 • Kubernetes半年ぐらい • インフラ7年ぐらい • ゲーム業界15年ぐらい • GAMECUBE
〜 PS3 あたり • MMORPG やソシャゲ • AWS や CEDEC 系に出没 • ちかごろ → → → • GCP 全般 • ライブ動画配信担当
今⽇のはなし • エンコーダーの負荷分散をどうやって検討〜実装したか • サーバ側で動画を再エンコードしてます(してないケースもあります) • 誰でも配信できます(来⽉リリース予定) • 遅延は2〜15秒ぐらい、⽤途や雰囲気でちょいちょい調整してる
構成 Kubernetes cluster GAE Microservices LB RTMP Logging Cloud Storage
GAE Media API GAE User API GKE Encoder GKE Chat LB RTMP GKE Encoder • Public User • Social & Streaming • Developer • Operator • Official Studio • Live streaming Cloud SQL Monitoring • Viewer Encoding Live Event Recording Internal Access Ingress / HTTPS websocket tool on IAP GKE Support Cloud SQL • PagerDuty • Slack GKE Chat GKE Redis GKE Dashboard GKE Certificate Manager GKE api GAE batch Cloud DNS *.wrightflyer.net Cloud Datastore 今⽇のはなし︕
負荷分散⽅法 • 新しいリクエストが来ないようにヘルスチェックを落とす • エンコードが始まったら readinessProbe を false にさせる •
念のため終わったら liveness も落として再起動させる • readiness → 新しいリクエストを受け付けたくない • liveness → 機能しなくなったので再起動したい • 実装が簡単で、概ね期待通りに動作した • Sidecar のいずれかの readiness が落ちていればオッケー • 全 Pod の readiness が落ちたままだと TCP 的にも繋がらなくなる • 503 とかそういうエラーも返せない • チャットサーバにも導⼊予定 • ⼊室すると⻑居するので random では先に起動した Pod に偏りすぎてしまう Pod Pod Pod Pod free free busy busy
ボツ案1 • Proxy-mode: ipvs 使う。 • round-robin や least-connection がある
• LC 設定する • 常に Pod の数を Encoder より多く • しかし GKE では ipvs 使えず︕ • iptables なので random のみ • 有⼒案だっただけにがっかり • オンプレ環境では ipvs 多い… https://kubernetes.io/docs/concepts/services-networking/service/#proxy-mode-ipvs
ボツ案2 • ⼤量の Service を作る。増減させる。 • 社内では node k8s.js |
kubectl create -f - として、 yaml を使わずに json を作り出 すパターンがちょいちょいある • helm よりお⼿軽だったのと、⾃由度が⾼くて AWS 構成管理でもよく使ってた • なので増やしたり減らしたりは結構かんたん • 1Service (LoadBalancer) 1Pod の構成が狙い • けど流⾏って数千⼈とか来てしまったらおそらく耐えられない • IP アドレス⾜りなくなるよねたぶん • お⾦もかかりそう(かからない︖)
没案3 • ロードバランサーのパスルールで振り分けられるようにする • Amazon ECS + Application Load Balancer
で特定のコンテナに WebSocket を振り 分けるのに使ったことがある • ただし、映像が送られてくるのは RTMP というプロトコルで HTTP ではない • RTMP にも URI のようなものはパケットの中に⼊っているので HTTP トンネルのよ うなもので振り分けられそうだけど、スマホからのアップロードに懸念があった Cloud Load Balancing Container Engine Container Engine Container Engine
課題 • HPA と相性があんまりよくないかも • 関⼼対象は CPU とか Mem じゃないので、そのままの仕組みが使えなかった
• Available な Pod の数を維持するような仕組みを開発・利⽤ • GKE で⼀般的な HTTP じゃない案件なので情報不⾜ • MMO とか MO も好きなんだけど Kubernetes では運⽤できる気がしない… • VTuber 関連技術エンジニア不⾜ • Unity, UE4, mocap, Streaming, GCP • C#, C++, swift, kotlin, gae-go, nodejs