SlideShare a Scribd company logo
1 of 22
SEDA(staged event-driven
architecture)
Joongjin Bae
@bae_j
本題に入る前!
• ConcurrencyとParallelismの説明はここでは割愛
します。
• 二つが混乱する方(me)は下記の資料をみてくだ
さい。
http://talks.golang.org/2012/waza.slide#1
• 動画
http://blog.golang.org/concurrency-is-notparallelism
ここではConcurrencyの
話をします!
Index
• 既存のConcurrencyの問題点
• SEDAの問題解決
既存のConcurrency
• Thread-based concurrency
• Bounded thread pool
• Event-driven concurrency
Thread-based concurrency
Thread-based concurrencyの問題
• Overhead発生しやすい
Bounded thread pools
• Thread-based concurrencyにスレッド制限を設
けた。
– Overheadが起きないように設定する
– 設定値以上のリクエストが受けないためClientの
待ち発生
Thread-basedはThroughput低下
Event-driven concurrency
Event-driven concurrency
• Throughput問題解決、latency犠牲
• Schedulerの実装が難しい
Structured event queue
• Event-driven concurrencyの問題解決版
• event queueのセットを利用しmodule化とアプ
リケーションの簡略化を狙う
SEDAとは
• Efficient, event-driven concurrency
• Dynamic thread pooling
• Structured queues for code modularity and
load management
• Self-tuning resource management
• 楽ですね!
Stage
Stage
• Controller
– リソース(threshold, rate-control, load shedding)の管理、スケジューリン
グ

• Event queue
– Input

• Thread pool
– Queueからeventを取り出しハンドラーを呼出す
– Poolは小さい

• Event handler
– Event処理、次のステージのQueueへ挿入

• Outgoing Event
– Output
Overload Management
Response Time(RT) Target設定:1 sec
90%のRTを監視し負荷が上がると
Token Bucket Rateを調整しEvent Queueへの挿入制御
Overload Management
Application = network of stages
Result : Throughput and Fairness
Result : Response time
Conclusion
• SEDAは
ThroughputとLatency両方満足できる
• SEDAフレームワークはhttp server
• 一応NettyもSEDAの考え方を取り入れている
Highly customizable thread model - single thread, one or more thread
pools such as SEDA
Reference
• http://www.eecs.harvard.edu/~mdw/papers/s
eda-sosp01.pdf
• http://netty.io/

More Related Content

More from Joongjin Bae

[LT] Continuous Delivery
[LT] Continuous Delivery [LT] Continuous Delivery
[LT] Continuous Delivery Joongjin Bae
 
理想の開発論-LT用
理想の開発論-LT用理想の開発論-LT用
理想の開発論-LT用Joongjin Bae
 
Aerospike紹介-LT用
Aerospike紹介-LT用Aerospike紹介-LT用
Aerospike紹介-LT用Joongjin Bae
 
Chapter 8 : Evaluation in Information Retrieval
Chapter 8 : Evaluation in Information RetrievalChapter 8 : Evaluation in Information Retrieval
Chapter 8 : Evaluation in Information RetrievalJoongjin Bae
 
voldemortの技術 - Dynamoとの比較
voldemortの技術 - Dynamoとの比較voldemortの技術 - Dynamoとの比較
voldemortの技術 - Dynamoとの比較Joongjin Bae
 
Programming in Scala Chapter 17 Collections
Programming in Scala Chapter 17 CollectionsProgramming in Scala Chapter 17 Collections
Programming in Scala Chapter 17 CollectionsJoongjin Bae
 
Cpuの速度向上はいかに実現されたのか
Cpuの速度向上はいかに実現されたのかCpuの速度向上はいかに実現されたのか
Cpuの速度向上はいかに実現されたのかJoongjin Bae
 

More from Joongjin Bae (8)

[LT] Continuous Delivery
[LT] Continuous Delivery [LT] Continuous Delivery
[LT] Continuous Delivery
 
理想の開発論-LT用
理想の開発論-LT用理想の開発論-LT用
理想の開発論-LT用
 
Aerospike紹介-LT用
Aerospike紹介-LT用Aerospike紹介-LT用
Aerospike紹介-LT用
 
Chapter 8 : Evaluation in Information Retrieval
Chapter 8 : Evaluation in Information RetrievalChapter 8 : Evaluation in Information Retrieval
Chapter 8 : Evaluation in Information Retrieval
 
voldemortの技術 - Dynamoとの比較
voldemortの技術 - Dynamoとの比較voldemortの技術 - Dynamoとの比較
voldemortの技術 - Dynamoとの比較
 
Programming in Scala Chapter 17 Collections
Programming in Scala Chapter 17 CollectionsProgramming in Scala Chapter 17 Collections
Programming in Scala Chapter 17 Collections
 
Cpuの速度向上はいかに実現されたのか
Cpuの速度向上はいかに実現されたのかCpuの速度向上はいかに実現されたのか
Cpuの速度向上はいかに実現されたのか
 
MapReduce基礎
MapReduce基礎MapReduce基礎
MapReduce基礎
 

Recently uploaded

論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 

Recently uploaded (9)

論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 

SEDA – Staged Event-Driven Architecture