Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kubernetesで分散処理をやってみる-Kafkaを添えて-
Search
Ogata Katsuya
September 13, 2025
0
220
Kubernetesで分散処理をやってみる-Kafkaを添えて-
Ogata Katsuya
September 13, 2025
Tweet
Share
More Decks by Ogata Katsuya
See All by Ogata Katsuya
Defensive LLM Calling
ogatakatsuya
0
140
AIで加速する文化祭ソフトウェア開発 / Software Development for School Festivals Accelerated by AI
ogatakatsuya
0
24
Vibe-Coding で作ったアプリを 文化祭で運用した話 / The story of running an app I built with Vibe-Coding at a school festival
ogatakatsuya
0
140
ハッカソンの勘所とエンジニアリングへの活かし方 / What Hackathons Teach Us and How to Bring That into Engineering
ogatakatsuya
0
25
ソフトウェアアーキテクチャ入門 / Introduction to Software Architecture
ogatakatsuya
0
120
大学のサークルプラットフォームを作った話
ogatakatsuya
0
110
Go College
ogatakatsuya
0
110
文化祭で使うアプリを1人で作った話
ogatakatsuya
0
96
twitter-cloneを作った話
ogatakatsuya
0
61
Featured
See All Featured
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
120
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
260
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
110
Rails Girls Zürich Keynote
gr2m
95
14k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
340
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
310
Between Models and Reality
mayunak
0
150
The Curse of the Amulet
leimatthew05
0
4.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
22
Transcript
2025-09-13 / ࢄٕज़ษڧձ~Ϋϥυͱࢄٕज़ͷΑ·~ KubernetesͰࢄॲཧΛͯ͠ΈΔ Katsuya Ogata
ࣗݾհ • ໊લ: ॹํ ࠀ࠸ (͓͕ͨ ͔ͭ) • ॴଐ: େࡕେֶใֶݚڀՊ
• ࣗαʔόʔ࢝Ί·ͨ͠ • Ӄࢼظؒதʹ5kgଠΓ·ͨ͠ • X: @ogata_katsuya • ݸਓ: www.ogatakatsuya.com
ࢄॲཧλεΫͷհ
ϨΠτϨʔγϯά ޫͷࣹɾ۶ંΛܭࢉͯ͠ɺߴ࣭ͳը૾Λੜ͢Δ • ޫઢͷʹΑΔը૾ੜख๏ • ԾΧϝϥ͔ΒͷޫઢΛγϛϡϨʔγϣϯ • ޫͷࣹɾ۶ંɾӨΛ࠶ݱ͢Δ • ܭࢉίετ͕ߴ͍
• ө૾CGɺݐஙՄࢹԽʹ͓͍ͯΘΕΔ https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-ray-tracing/implementing-the-raytracing-algorithm.htm ޫઢͷʹΑΔը૾ੜख๏
ϨΠτϨʔγϯά ޫͷࣹɾ۶ંΛܭࢉͯ͠ɺߴ࣭ͳը૾Λੜ͢Δ • ܭࢉྔ O ( P * R *
S * D) • P: ϐΫηϧ • R: ϐΫηϧ͋ͨΓͷޫઢ • S: ΦϒδΣΫτ • D: ࣹ/۶ંਂ • ࠓճͷ߹ɺO ( 800*800 * 50 * 8 * 8 ) = O ( 2,048,000,000 ) • ͜ΕΛ100pixel͝ͱʹׂͯ͠ɺॲཧΛฒྻ࣮ߦ͢Δ
Kubernetesͷࢄॲཧ Node/PodʹॲཧΛࢄ͢Δ͜ͱʹΑ࣮ͬͯݱ͢Δ https://kubernetes.io/ja/docs/concepts/overview/components/
ߟ͑ΒΕΔΞʔΩςΫνϟ ͋ΔPod͕WorkerʹԿΒ͔ͷ௨৴खஈͰσʔλΛͯ͠ฦ͢
ߟ͑ΒΕΔΞʔΩςΫνϟ ͋ΔPod͕WorkerʹԿΒ͔ͷ௨৴खஈͰσʔλΛͯ͠ฦ͢ • σϝϦοτ • Worker PodͷΞυϨεʁʁ • Producer -
Workerؒͷ௨৴खஈʁʁ • ࠶ૹɾϦτϥΠॲཧ͕ඞཁʹͳΔʁʁ • ॲཧதʹαʔόʔ͕མͪͨΒϝοηʔδফ͑ͯ͠·͏ʁʁ • ॲཧ͕ॏ͘ͳͬͨ࣌ʹͲ͏ͬͯରԠ͢Δʁʁ
ͦ͏ͩɺKafkaΛ͓͏
KafkaΛ༻͍ͨࢄॲཧ Pub/Sub messaging model https://aws.amazon.com/jp/what-is/pub-sub-messaging/
KafkaΛ༻͍ͨࢄॲཧ Pub/Sub messaging model • ϝϦοτ • ௨৴ͱϏδωεϩδοΫ͕ૄ݁߹ʹͳΔ • PublisherͱSubscriberΛ༰қʹεέʔϧͰ͖Δ
• ඇಉظͰॲཧΛ࣮ߦͰ͖Δ • ΠϕϯτۦಈΞʔΩςΫνϟͷԠ༻ • োੑ
͜ΕΛKubernetes্Ͱ࣮ݱ͍ͨ͠
KubernetesͷΞʔΩςΫνϟ Pub/Sub messaging model
KubernetesͷΞʔΩςΫνϟ Pub/Sub messaging model
KubernetesͷΞʔΩςΫνϟ Pub/Sub messaging model
KubernetesͷΞʔΩςΫνϟ Pub/Sub messaging model
࣮ݧ
࣮ݧ༰ GKEΛ༻͍ͯɺSubscriberͷΛมԽͤ͞Δ • 3~6 Node • n2-standard-4 (4vCPU / 16GB)
• ϦιʔεͷϦΫΤετʹԠͯ͡εέʔϧ • Subscriber • 1 / 10 / 20 / 30 / 40 / 50 / 60 / 70 / 80 Pod • ֤PodͷϦιʔε • CPU: 250m ~ 500m • ϝϞϦ: 256Mi ~ 512Mi
݁Ռ
࣮ݧ݁Ռ Pod ॲ ཧ ࣌ ؒ 0 550 1100 1650
2200 1 10 20 30 40 50 60 70 80 1 pod 2105 seconds 20 pods 689 seconds 80 pods 368 seconds
·ͱΊ
• KubernetesΛ༻͍Δ͜ͱͰɺPub/SubϞσϧͰͷࢄॲཧΛखܰʹߦ͏͜ͱ ͕Ͱ͖Δ • KafkaΛ༻͍Δ͜ͱͰɺSubscriberΛεέʔϧͤͯ͞ॲཧ࣌ؒΛॖ͢Δ͜ͱ ͕Ͱ͖Δ • https://github.com/ogatakatsuya/distributed-tasks • ڵຯͷ͋Δํ͍ͯΈ͍ͯͩ͘͞
• ٞվળ͋Εڭ͍͑ͯͩ͘͞ʂ ·ͱΊ
ࢀߟจݙ • Kubernetes • KubernetesશΨΠυ ୈ2൛ • Ray-tracing • https://www.scratchapixel.com/lessons/3d-basic-rendering
• Kafka • https://speakerdeck.com/oracle4engineer/shin-kafka • https://speakerdeck.com/hashitokyo/apache-kafka-and-the-world-of- streams