SlideShare a Scribd company logo
Scalable
(dkmoon@ifunfactory.com)
2018 iFunFactory Dev Day
Scalability?
Scalability is the capability of a system, network, or process
to handle a growing amount of work, or its potential to be
enlarged to accommodate that growth.
- Wikipedia
2018 iFunFactory Dev Day
Scalability?
Scalability is the capability of a system, network, or process
to handle a growing amount of work, or its potential to be
enlarged to accommodate that growth.
- Wikipedia
Scalability is the capability of a system, network, or process
to handle a growing amount of work, or its potential to be
enlarged to accommodate that growth.
Scalability , ,
,
2018 iFunFactory Dev Day
Scalability Question in Gaming
Q) ?
2018 iFunFactory Dev Day
...
2018 iFunFactory Dev Day
Scalability Question in Gaming
Q) ?
Q) ?
2018 iFunFactory Dev Day
Scalability Question in Gaming
Q) ?
Q) ?
A1)
2018 iFunFactory Dev Day
Scalability Question in Gaming
Q) ?
Q) ?
A1)
A2)
2018 iFunFactory Dev Day
Contents.
01
02
03
04 /
05 DB
2018 iFunFactory Dev Day
Offhand Approach
“Scale-up”
SW HW
2018 iFunFactory Dev Day
Scale-up

for High Per-server Capacity
Pros:
(SW)
2018 iFunFactory Dev Day
Scale-up

for High Per-server Capacity
Pros:
(SW)
(via container/VM)
2018 iFunFactory Dev Day
Intel Xeon E5-46XX v4 Family Retail Prices

(Launched in Q2’16)
USD 0
USD 2000
USD 4000
USD 6000
USD 8000
E5-4610
v4
E5-4620
v4
E5-4627
v4
E5-4640
v4
E5-4650
v4
E5-4660
v4
E5-4667
v4
E5-4669
v4
2018 iFunFactory Dev Day
Scale-up

for High Per-server Capacity
Cons:
2018 iFunFactory Dev Day
Scale-up

for High Per-server Capacity
Cons:
HW
2018 iFunFactory Dev Day
Scale-up

for High Per-server Capacity
Cons:
HW
2018 iFunFactory Dev Day
Harmonious Approach
“ SW ”
2018 iFunFactory Dev Day
Golden Rule
Minimize Inefficiency
Maximize Concurrency
2018 iFunFactory Dev Day
Inefficiency = Wasting CPU time
2018 iFunFactory Dev Day
Inefficiency = Wasting CPU time
2018 iFunFactory Dev Day
Inefficiency = Wasting CPU time
2018 iFunFactory Dev Day
Inefficiency = Wasting CPU time
) Indexing vs. Looping
Guide #1.
big O
coefficient
Guide #2. Busy-Waiting
Asynchronous ( )
2018 iFunFactory Dev Day
Code Efficiency vs. Readability
Q) 10%
50% ?
2018 iFunFactory Dev Day
Readability = Reliability
=
=
= @_@/
( , !)
2018 iFunFactory Dev Day
Efficiency vs. Readability
trade-off
➡ efficiency
2018 iFunFactory Dev Day
Concurrency
( ..)
2018 iFunFactory Dev Day
Concurrency Units
Threads (preemptive or cooperative)
Processes (local or remote)
2018 iFunFactory Dev Day
More Units != More Concurrency
By Benjamin D. Esham / Wikimedia Commons, CC BY-SA 3.0

https://commons.wikimedia.org/w/index.php?curid=56559
2018 iFunFactory Dev Day
Concurrency
( ..)
2018 iFunFactory Dev Day
For Better Concurrency
,
Blocking
2018 iFunFactory Dev Day
For Better Concurrency
Guide #1.
Guide #2.
2018 iFunFactory Dev Day
Concurrency Control
Concurrent
sequential
2018 iFunFactory Dev Day
Concurrency Control
Concurrent
sequential
➡ Shared data
2018 iFunFactory Dev Day
Pessimistic Concurrency Control
2018 iFunFactory Dev Day
Pessimistic Concurrency Control
•
• Shared data
• ) lock

RDBMS xaction
2018 iFunFactory Dev Day
Optimistic Concurrency Control
•
• Shared data ,



Roll-back & retry
2018 iFunFactory Dev Day
Q) ? DBMS ?
Optimistic Concurrency Control
2018 iFunFactory Dev Day
Q) ? DBMS ?
A) ?
Optimistic Concurrency Control
2018 iFunFactory Dev Day
synchronization primitive
primitive
Optimistic CC ( )
2018 iFunFactory Dev Day
Pessimistic CC ( - )
Shared ObjectThread A Thread B
Write Lock
Read
Write
Unlock
Process Locked
2018 iFunFactory Dev Day
Pessimistic CC ( - )
Shared ObjectThread A Thread B
Write Lock
Read
Write
Unlock
Process Locked
Read Lock Req
Read Lock Return
blocked
2018 iFunFactory Dev Day
Optimistic CC ( - )
Shared ObjectThread A Thread B
Read Lock
Read (Rev=1)
Commit (Rev=1)
Unlock
Process
Locked
Write Lock
Unlock
Locked
2018 iFunFactory Dev Day
Optimistic CC ( - )
Shared ObjectThread A Thread B
Read Lock
Read (Rev=1)
Commit (Rev=1)
Unlock
Process
Locked
Write Lock
Unlock
Read Lock
Read (Rev=1)
Unlock
2018 iFunFactory Dev Day
Pessimistic CC ( - )
Shared ObjectThread A Thread B
Write Lock
Read
Write
Unlock
Process Locked
Write Lock Req
Write Lock Return
blocked
2018 iFunFactory Dev Day
Optimistic CC ( - )
Read Lock
Read (Rev=1)
Commit (Rev=1)
Unlock
Process
Locked
Write Lock
Unlock
Read Lock
Read (Rev=1)
Unlock
2018 iFunFactory Dev Day
Optimistic CC ( - )
Read Lock
Read (Rev=1)
Commit (Rev=1)
Unlock
Process
Locked
Write Lock
Unlock
Read Lock
Read (Rev=1)
Unlock
Write Lock
Commit (Rev=1, REJECT)
Locked
Process
2018 iFunFactory Dev Day
Optimistic CC ( - )
Read Lock
Read (Rev=1)
Commit (Rev=1)
Unlock
Process
Locked
Write Lock
Unlock
Read Lock
Read (Rev=1)
Unlock
Write Lock
Commit (Rev=1, REJECT)
Locked
Read (Rev=2)
Unlock Roll back & Retry
Process
Process
2018 iFunFactory Dev Day
Pessimistic CC vs. Optimistic CC
2018 iFunFactory Dev Day
Pessimistic CC vs. Optimistic CC
Pessimistic Optimistic
Low contention
High contention progress
rollback&retry
(progress )
2018 iFunFactory Dev Day
•High contention
•Low contention
Pessimistic CC vs. Optimistic CC
➡ Pessimistic
➡ Optimistic
2018 iFunFactory Dev Day
Optimistic CC ( )
•
• in-game 

( : )
2018 iFunFactory Dev Day
Optimistic CC ( )
•
• in-game 

( : )
•
2018 iFunFactory Dev Day
Key Questions…
• workload ?
2018 iFunFactory Dev Day
Key Questions…
• workload ?
• ?
2018 iFunFactory Dev Day
Key Questions…
• workload ?
• ?
• ?
2018 iFunFactory Dev Day
Key Questions…
• workload ?
• ?
• ?
• ?
2018 iFunFactory Dev Day
Workload Distribution
Domain-
agnostic
Domain-
specific
2018 iFunFactory Dev Day
Domain-agnostic Distribution
instance
stateless processing unit
) web server scaling 

PUBG
2018 iFunFactory Dev Day
Domain-specific Distribution
in-memory state
) RPG 

,
2018 iFunFactory Dev Day
Workload Distribution
Domain-Agnostic Domain-Specific
state
Scale-out
reconfiguration
State
DB/Cache (centralized)
RPC (distributed)
in-memory
master-slave
replication
2018 iFunFactory Dev Day
Workload Distribution Guideline
2018 iFunFactory Dev Day
Workload Distribution Guideline
2018 iFunFactory Dev Day
Workload Distribution Guideline
✓ Concurrency 

• Unit: thread → (remote) process
2018 iFunFactory Dev Day
Workload Distribution Guideline
✓ Concurrency 

• Unit: thread → (remote) process
➡ , blocking
2018 iFunFactory Dev Day
Dos & Don’ts
✓
✓ : Lobby vs. Room → specific

Room instances → agnostic
2018 iFunFactory Dev Day
Dos & Don’ts
✓
✓ : Lobby vs. Room → specific

Room instances → agnostic
✓ Stateless stateful
✓ Stateful stateless
✓ : RPG workhorse
2018 iFunFactory Dev Day
Static Peer Configuration
Pros
•
•
2018 iFunFactory Dev Day
Static Peer Configuration
Cons
• Dev Live
• Live
2018 iFunFactory Dev Day
Dynamic Peer Discovery
• registry 

: Zookeeper, Redis, DB, …
•
• RPC endpoint
• Server tags
2018 iFunFactory Dev Day
Dynamic Peer Discovery
RPC=<IP, port>
TAGS=[“lobby”]
2018 iFunFactory Dev Day
Dynamic Peer Discovery
RPC=<IP, port>
TAGS=[“lobby”]
RPC=<IP, port>
TAGS=[“game”, “chobo"]
2018 iFunFactory Dev Day
Dynamic Peer Discovery
RPC=<IP, port>
TAGS=[“lobby”]
RPC=<IP, port>
TAGS=[“game”, “chobo"]
2018 iFunFactory Dev Day
Dynamic Peer Discovery
RPC=<IP, port>
TAGS=[“lobby”]
RPC=<IP, port>
TAGS=[“game”, “chobo"]
2018 iFunFactory Dev Day
Pitfall: DB as Sync Point
DB
•
• atomicity
2018 iFunFactory Dev Day
Pitfall: DB as Sync Point
...
DB ( )
2018 iFunFactory Dev Day
Pitfall: DB as Sync Point
2018 iFunFactory Dev Day
Pitfall: DB as Sync Point
Solution #1. DB Cache
Solution #2.
2018 iFunFactory Dev Day
Optimistic CC ( )
• RPC
• PCC
•OCC
2018 iFunFactory Dev Day
RECAP
✓ 2
• Minimize Inefficiency
• Maximize Concurrency
2018 iFunFactory Dev Day
RECAP
✓ 2
• Minimize Inefficiency
• Maximize Concurrency
✓ , Concurrency
2018 iFunFactory Dev Day
RECAP
✓ 2
• Minimize Inefficiency
• Maximize Concurrency
✓ , Concurrency
✓ Concurrency 2
•
•
Q&A
2018 iFunFactory Dev Day
2018 iFunFactory Dev Day
Thank You!
660, 1 B 606
+82-70-4923-6566 www.ifunfactory.cominfo@ifunfactory.com

More Related Content

PDF
[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석
PPTX
SnapyX
PDF
はじめての JFrog Artifactory
PPTX
Protractor: The Hacker way (NG-MY 2019)
PDF
デザインシステムの海で3年間もがいてみて
PDF
[Workshop] "Vuetify in practice", Alexander Stepanov
PDF
給 RD 的 Kubernetes 初體驗 (EKS version)
PDF
手機自動化測試和持續整合
[아이펀팩토리] 2018 데브데이 서버위더스 _04 리눅스 게임 서버 성능 분석
SnapyX
はじめての JFrog Artifactory
Protractor: The Hacker way (NG-MY 2019)
デザインシステムの海で3年間もがいてみて
[Workshop] "Vuetify in practice", Alexander Stepanov
給 RD 的 Kubernetes 初體驗 (EKS version)
手機自動化測試和持續整合

What's hot (20)

PDF
EsiGate dev meeting #5 15-05-2014
PDF
Import golang; struct microservice - Codemotion Rome 2015
PDF
13 practical tips for writing secure golang applications
PDF
Spring Dynamic Modules for OSGi by Example - Martin Lippert, Consultant
PDF
Jenkins vs GitLab CI
KEY
Is OSGi modularity always worth it?
PDF
Spring5 New Features - Nov, 2017
PDF
The story of language development
PDF
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
PDF
Rene Groeschke
PDF
[D2 campus seminar]웹브라우저 엔진
PDF
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
PDF
Solving the Workflow (or, how MODX.today is being built with git and Gitify)
PDF
Webpack & React Performance in 16+ Steps
PPTX
Using Azure Runbooks and Microsoft Flow to Automate SharePoint Tasks
PDF
Jenkins to Gitlab - Intelligent Build-Pipelines
PDF
猿でもわかる Helm
PPTX
PHP and FastCGI Performance Optimizations
PDF
Trunk-Based Development
PDF
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
EsiGate dev meeting #5 15-05-2014
Import golang; struct microservice - Codemotion Rome 2015
13 practical tips for writing secure golang applications
Spring Dynamic Modules for OSGi by Example - Martin Lippert, Consultant
Jenkins vs GitLab CI
Is OSGi modularity always worth it?
Spring5 New Features - Nov, 2017
The story of language development
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
Rene Groeschke
[D2 campus seminar]웹브라우저 엔진
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
Solving the Workflow (or, how MODX.today is being built with git and Gitify)
Webpack & React Performance in 16+ Steps
Using Azure Runbooks and Microsoft Flow to Automate SharePoint Tasks
Jenkins to Gitlab - Intelligent Build-Pipelines
猿でもわかる Helm
PHP and FastCGI Performance Optimizations
Trunk-Based Development
Alexander Mostovenko "'Devide at impera' with GraphQL and SSR"
Ad

Similar to [아이펀팩토리] 2018 데브데이 서버위더스 _03 Scalable 한 게임 서버 만들기 (20)

PDF
GitOps Core Concepts & Ways of Structuring Your Repos
PDF
Guides To Analyzing WebKit Performance
PDF
Testing Vue Apps with Cypress.io (STLJS Meetup April 2018)
PDF
Integrating Existing C++ Libraries into PySpark with Esther Kundin
PDF
SAIS/DWS2018報告会 #saisdws2018
PDF
Grails 4: Upgrade your Game!
PPT
Testing of javacript
PDF
Unlocking the Power of Iteration
KEY
Agile toolkit present 2012
KEY
Agile toolkit present 2012
PDF
Fernando Arnaboldi - Exposing Hidden Exploitable Behaviors Using Extended Dif...
PDF
WSO2Con EU 2015: Keynote - The Containerization of the Developer Workspace
PDF
Grokking Techtalk #38: Escape Analysis in Go compiler
PPTX
Advanced technologies and techniques for debugging HPC applications
PDF
From zero to one - How we evolved our test automation processes and mindset i...
PDF
Automate, Integrate, Innovate - AI-powered GitLab CI for Drupal module develo...
PDF
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
PPTX
Web Performance & Latest in React
PPTX
Cloudstack Continuous Delivery
PDF
Automate, Integrate, Innovate - AI-powered GitLab CI for Drupal module develo...
GitOps Core Concepts & Ways of Structuring Your Repos
Guides To Analyzing WebKit Performance
Testing Vue Apps with Cypress.io (STLJS Meetup April 2018)
Integrating Existing C++ Libraries into PySpark with Esther Kundin
SAIS/DWS2018報告会 #saisdws2018
Grails 4: Upgrade your Game!
Testing of javacript
Unlocking the Power of Iteration
Agile toolkit present 2012
Agile toolkit present 2012
Fernando Arnaboldi - Exposing Hidden Exploitable Behaviors Using Extended Dif...
WSO2Con EU 2015: Keynote - The Containerization of the Developer Workspace
Grokking Techtalk #38: Escape Analysis in Go compiler
Advanced technologies and techniques for debugging HPC applications
From zero to one - How we evolved our test automation processes and mindset i...
Automate, Integrate, Innovate - AI-powered GitLab CI for Drupal module develo...
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Web Performance & Latest in React
Cloudstack Continuous Delivery
Automate, Integrate, Innovate - AI-powered GitLab CI for Drupal module develo...
Ad

More from iFunFactory Inc. (20)

PDF
2019 아이펀팩토리 Dev Day 세션6 아이펀엔진 운영툴 연동하기 - 장수원
PDF
2019 아이펀팩토리 Dev Day 세션5 아이펀엔진으로 만든 게임 성능 분석 및 디버깅 - 남승현
PDF
2019 아이펀팩토리 Dev Day 세션4 아이펀엔진에 MO 게임 콘텐츠 채워 넣기 - 남승현
PDF
2019 아이펀팩토리 Dev Day 세션3 아이펀엔진 개발 환경 설정하기 (Windows+ VS) - 김진욱
PDF
2019 아이펀팩토리 Dev Day 세션2 아이펀엔진 개발 환경 설정하기 (Linux + VS Code) - 김진욱
PDF
2019 아이펀팩토리 Dev Day 세션1 네트워크 프로그래밍 개론 - 문대경 대표
PDF
[MGDC] 리눅스 게임 서버 성능 분석하기 - 아이펀팩토리 김진욱 CTO
PDF
[아이펀팩토리] 2018 데브데이 서버위더스 _01 HTML5/WebSocket으로 Pong 게임 만들기
PDF
[아이펀팩토리] 2018 데브데이 서버위더스 _02 분산 환경을 위한 ORM 개발 경험 공유
PDF
[아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기
PDF
[아이펀팩토리] 2017 NDCP
PPT
[아이펀팩토리]2017 NDC 강연 자료_아이펀 엔진 개발 노트
PDF
게임서버 구축 방법비교 : GBaaS vs. Self-hosting
PDF
유니티 쉐이더 단기속성
PDF
게임 서버 성능 분석하기
PDF
혼자서 만드는 MMO게임 서버
PDF
Python과 AWS를 이용하여 게임 테스트 환경 구축하기
PPTX
PC 와 모바일에서의 P2P 게임 구현에서의 차이점 비교
PPTX
Docker 로 Linux 없이 Linux 환경에서 개발하기
PPTX
게임 운영에 필요한 로그성 데이터들에 대하여
2019 아이펀팩토리 Dev Day 세션6 아이펀엔진 운영툴 연동하기 - 장수원
2019 아이펀팩토리 Dev Day 세션5 아이펀엔진으로 만든 게임 성능 분석 및 디버깅 - 남승현
2019 아이펀팩토리 Dev Day 세션4 아이펀엔진에 MO 게임 콘텐츠 채워 넣기 - 남승현
2019 아이펀팩토리 Dev Day 세션3 아이펀엔진 개발 환경 설정하기 (Windows+ VS) - 김진욱
2019 아이펀팩토리 Dev Day 세션2 아이펀엔진 개발 환경 설정하기 (Linux + VS Code) - 김진욱
2019 아이펀팩토리 Dev Day 세션1 네트워크 프로그래밍 개론 - 문대경 대표
[MGDC] 리눅스 게임 서버 성능 분석하기 - 아이펀팩토리 김진욱 CTO
[아이펀팩토리] 2018 데브데이 서버위더스 _01 HTML5/WebSocket으로 Pong 게임 만들기
[아이펀팩토리] 2018 데브데이 서버위더스 _02 분산 환경을 위한 ORM 개발 경험 공유
[아이펀팩토리] 클라이언트 개발자, 서버 개발 시작하기
[아이펀팩토리] 2017 NDCP
[아이펀팩토리]2017 NDC 강연 자료_아이펀 엔진 개발 노트
게임서버 구축 방법비교 : GBaaS vs. Self-hosting
유니티 쉐이더 단기속성
게임 서버 성능 분석하기
혼자서 만드는 MMO게임 서버
Python과 AWS를 이용하여 게임 테스트 환경 구축하기
PC 와 모바일에서의 P2P 게임 구현에서의 차이점 비교
Docker 로 Linux 없이 Linux 환경에서 개발하기
게임 운영에 필요한 로그성 데이터들에 대하여

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Tartificialntelligence_presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
1. Introduction to Computer Programming.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Mushroom cultivation and it's methods.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Tartificialntelligence_presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Accuracy of neural networks in brain wave diagnosis of schizophrenia
1. Introduction to Computer Programming.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Programs and apps: productivity, graphics, security and other tools
Spectral efficient network and resource selection model in 5G networks
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Mushroom cultivation and it's methods.pdf
TLE Review Electricity (Electricity).pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Reach Out and Touch Someone: Haptics and Empathic Computing

[아이펀팩토리] 2018 데브데이 서버위더스 _03 Scalable 한 게임 서버 만들기