SlideShare a Scribd company logo
1 of 71
Download to read offline
KUBERNETES
RESOURCE
MISMANAGEMENT
Natan Yellin aantn
About me
Robusta.dev co-founder
Developer
Low level stuff
Marketing fun
Natan Yellin aantn
What we'll talk about
3 reasons scheduling is hard
2 warm-up questions
4 misconceptions and mistakes
Natan Yellin aantn
Natan Yellin aantn
scheduling
Natan Yellin aantn
pods nodes
Natan Yellin aantn
pods nodes
Natan Yellin aantn
pods nodes
Natan Yellin aantn
pods nodes
2 cpu
Natan Yellin aantn
pods nodes
2 cpu
1 cpu
Natan Yellin aantn
nodes
Natan Yellin aantn
pods nodes
2 cpu
1 cpu
Natan Yellin aantn
pods nodes
2 cpu
1 cpu
a request is an estimate of the resources a pod
will need
Natan Yellin aantn
if only things were
that simple...
Natan Yellin aantn
challenge 1
inaccurate
predictions
Natan Yellin aantn
our estimated cpu usage
nodes
A
Natan Yellin aantn
actual cpu usage
nodes
A
Natan Yellin aantn
challenge 2
high switching costs
Natan Yellin aantn
switching costs
nodes
B
A
Natan Yellin aantn
spin up a new node
nodes
B
Natan Yellin aantn
terminate existing
pod
nodes
B
Natan Yellin aantn
nodes
Natan Yellin aantn
start new pod
nodes
B
Natan Yellin aantn
challenge 3
its not just cpu
Natan Yellin aantn
cpu request
pods nodes
2 cpu
1 cpu
Natan Yellin aantn
cpu request
memory request
pods nodes
2 cpu
1 cpu
1 gb
4 gb
Natan Yellin aantn
cpu request
memory request
other resources (gpu, huge pages, etc)
pods nodes
2 cpu
1 cpu
1 gb
4 gb
0.5 gpu
1 gpu
Natan Yellin aantn
the real world
Natan Yellin aantn
the real world
Natan Yellin aantn
2 warm up questions
A
Natan Yellin aantn
Pod A requested 1 CPU but is actually using 2 CPU
actual usage = 2 CPU
request = 1 CPU
B
A
Natan Yellin aantn
Pod A requested 1 CPU but is actually using 2 CPU
Pod B is created and requests 1 CPU
actual usage = 2 CPU
request = 1 CPU
request = 1 CPU
B
A
Natan Yellin aantn
Will pod B be scheduled?
actual usage = 2 CPU
request = 1 CPU
request = 1 CPU
A
Natan Yellin aantn
Pod B will be scheduled!
kubernetes does not look at actual usage when
scheduling
B
B
A
Natan Yellin aantn
nodes
After scheduling, Pod A tries to use all the CPUs on
the node.
B
A
Natan Yellin aantn
nodes
Will Pod B get the 1 CPU it requested?
B
A
Natan Yellin aantn
nodes
Requests are enforced at runtime!
Pods are always guaranteed their request!
B
A
zz
Natan Yellin aantn
nodes
If B isn't doing anything...
B
A
zz
Natan Yellin aantn
nodes
If B isn't doing anything... we'll let A get away with it.
No harm done!
A
Natan Yellin aantn
nodes
Assuming this doesn't break A's limits
Natan Yellin aantn
4 misconceptions
and mistakes
A pod will not be CPU
throttled if CPU is under
the limit
Natan Yellin aantn
Natan Yellin aantn
Demo
Natan Yellin aantn
Natan Yellin aantn
cpu limits
1 second
Natan Yellin aantn
cpu limits
100 ms 100 ms 100 ms 100 ms 100 ms 100 ms
Natan Yellin aantn
cpu limits
100 ms 100 ms 100 ms 100 ms 100 ms 100 ms
Natan Yellin aantn
cpu limits
100 ms 100 ms 100 ms 100 ms 100 ms 100 ms
100 ms
Natan Yellin aantn
cpu limits
100 ms 100 ms 100 ms 100 ms 100 ms 100 ms
50 ms
Natan Yellin aantn
cpu limits
100 ms 100 ms 100 ms 100 ms 100 ms 100 ms
50 ms
Natan Yellin aantn
cpu limits
100 ms 100 ms 100 ms 100 ms 100 ms 100 ms
Natan Yellin aantn
cpu limits
100 ms 100 ms 100 ms 100 ms 100 ms 100 ms
throttling
Learn more
Natan Yellin aantn
link
If my node has 4 CPUs
then I can fill up 4 CPUs
with requests
Natan Yellin aantn
Natan Yellin aantn
Natan Yellin aantn
...
demo
Natan Yellin aantn
When you go over a
memory limit you get
OOMKilled
Natan Yellin aantn
Natan Yellin aantn
OOMKill
Natan Yellin aantn
Natan Yellin aantn
cpu memory
Natan Yellin aantn
a pod is using more memory than expected
it doesn't have a limit
the node runs out of memory
what pod gets killed?
Natan Yellin aantn
there is no simple answer!
*but in the future this will get better: https://kubernetes.io/blog/2021/11/26/qos-memory-resources/
Natan Yellin aantn
always set memory limits
set request=limit so pods will only be killed for their own behaviour
One pod can't cause
another to stop running
Natan Yellin aantn
Natan Yellin aantn
Natan Yellin aantn
A
A
B
B comes along and evicts A
Natan Yellin aantn
A A
B
Having enough capacity in the cluster doesn't mean
everything can run!
e.g. anti-affinities
Natan Yellin aantn
A A
B
Questions?
Natan Yellin aantn
Other recent talks
Natan Yellin aantn
Building a runbook automation system for Prometheus and
Kubernetes
Thank you!
Follow on LinkedIn for
more content
Natan Yellin
Natan Yellin aantn

More Related Content

What's hot

What's hot (20)

Unit Test
Unit TestUnit Test
Unit Test
 
Performance tests with Gatling (extended)
Performance tests with Gatling (extended)Performance tests with Gatling (extended)
Performance tests with Gatling (extended)
 
CNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed HashingCNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed Hashing
 
Metasploit For Beginners
Metasploit For BeginnersMetasploit For Beginners
Metasploit For Beginners
 
RPA with UIPath and Flaui
RPA with UIPath and FlauiRPA with UIPath and Flaui
RPA with UIPath and Flaui
 
Présentation Agile Testing
Présentation Agile TestingPrésentation Agile Testing
Présentation Agile Testing
 
Deep Exploit@Black Hat Europe 2018 Arsenal
Deep Exploit@Black Hat Europe 2018 ArsenalDeep Exploit@Black Hat Europe 2018 Arsenal
Deep Exploit@Black Hat Europe 2018 Arsenal
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
Astuces de Scrum Master pour varier vos rétros
Astuces de Scrum Master pour varier vos rétrosAstuces de Scrum Master pour varier vos rétros
Astuces de Scrum Master pour varier vos rétros
 
Hướng dẫn khôi phục tập tin đã xóa hay bị ghi đè trên nas synology
Hướng dẫn khôi phục tập tin đã xóa hay bị ghi đè trên nas synologyHướng dẫn khôi phục tập tin đã xóa hay bị ghi đè trên nas synology
Hướng dẫn khôi phục tập tin đã xóa hay bị ghi đè trên nas synology
 
Automação de Teste em Front End - Caipira Ágil
Automação de Teste em Front End - Caipira ÁgilAutomação de Teste em Front End - Caipira Ágil
Automação de Teste em Front End - Caipira Ágil
 
우리 제품의 검증 프로세스 소개 자료
우리 제품의 검증 프로세스 소개 자료 우리 제품의 검증 프로세스 소개 자료
우리 제품의 검증 프로세스 소개 자료
 
Metasploit for Penetration Testing: Beginner Class
Metasploit for Penetration Testing: Beginner ClassMetasploit for Penetration Testing: Beginner Class
Metasploit for Penetration Testing: Beginner Class
 
테스트자동화와 TDD
테스트자동화와 TDD테스트자동화와 TDD
테스트자동화와 TDD
 
Pet Pen Testing Tools: Zenmap & Nmap
Pet Pen Testing Tools: Zenmap & NmapPet Pen Testing Tools: Zenmap & Nmap
Pet Pen Testing Tools: Zenmap & Nmap
 
OWASP Top 10 2017
OWASP Top 10 2017OWASP Top 10 2017
OWASP Top 10 2017
 
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida
IDA Vulnerabilities and Bug Bounty  by Masaaki ChidaIDA Vulnerabilities and Bug Bounty  by Masaaki Chida
IDA Vulnerabilities and Bug Bounty  by Masaaki Chida
 
Bypassing nac solutions and mitigations
Bypassing nac solutions and mitigationsBypassing nac solutions and mitigations
Bypassing nac solutions and mitigations
 
Computer Security - CCNA Security - Lecture 1
Computer Security - CCNA Security - Lecture 1Computer Security - CCNA Security - Lecture 1
Computer Security - CCNA Security - Lecture 1
 
Intro to CliWrap
Intro to CliWrapIntro to CliWrap
Intro to CliWrap
 

Recently uploaded

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Kubernetes Resource Mis-management - What not to do