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
1
140
ハッカソンの勘所とエンジニアリングへの活かし方 / What Hackathons Teach Us and How to Bring That into Engineering
ogatakatsuya
0
25
ソフトウェアアーキテクチャ入門 / Introduction to Software Architecture
ogatakatsuya
1
120
大学のサークルプラットフォームを作った話
ogatakatsuya
0
110
Go College
ogatakatsuya
0
110
文化祭で使うアプリを1人で作った話
ogatakatsuya
0
97
twitter-cloneを作った話
ogatakatsuya
0
61
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
39k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Designing Powerful Visuals for Engaging Learning
tmiket
0
190
Utilizing Notion as your number one productivity tool
mfonobong
2
190
Ruling the World: When Life Gets Gamed
codingconduct
0
100
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
89
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
280
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
120
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
17
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
120
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