SlideShare une entreprise Scribd logo
1  sur  38
Don't Let Clients Get You Down
Configuring Fault-Tolerant Clients in Resilient Systems
Clare Liguori
Principal Engineer, Amazon Web Services
#Hopperx1Seattle
Clients! Clients!
LB
LB
=(
LB
=(
LB
=(
X
X
LB
=(
Retry
#Hopperx1Seattle
Timeout Backoff
Don’t Let Clients Get You Down
Retry
#Hopperx1Seattle
Timeout Backoff
Don’t Let Clients Get You Down
LB
=(
If at first
you don’t
succeed
LB
=(
Retry!
$ npm install
npm ERR! fetch failed git+ssh://...
~/.ssh/config:
Host *
ConnectionAttempts 3
LB
=(
=(
=(
10 Retries
=
100 Requests
x
10 Retries
Set sane
retry limits!
LB
=(
Only retry on
idempotent APIs
Pizzas
ordered:
0
=(
LB
=(
Only retry on
idempotent APIs
Pizzas
ordered:
0
=(
Try #1:
Connection
drops
LB
=(
Only retry on
idempotent APIs
Pizzas
ordered:
0
=(
Try #2:
Connection
drops
LB
=(
Only retry on
idempotent APIs
Pizzas
ordered:
1
=(
Try #3:
Success!
LB
Only retry on
idempotent APIs
Pizzas
ordered:
3
Uh oh, those
servers are
healthy again
Retry
#Hopperx1Seattle
Timeout Backoff
Don’t Let Clients Get You Down
LB
connection timeout
socket timeout
read timeout
write timeout
individual request timeout
overall timeout including retries
Time
ThreadsInUse
=(
=)
Max Threads
$ curl https://checkip.amazonaws.com
$ curl --retry 3 
--connect-timeout 10 
--max-time 20 
https://checkip.amazonaws.com
Retry
#Hopperx1Seattle
Timeout Backoff
Don’t Let Clients Get You Down
LB
=(
=(
=(
10 Retries
=
100 Requests
x
10 Retries
sleep(2)
sleep(0.5)
sleep(1)
sleep(2)
sleep(4)
sleep(8)
sleep(0.5)
sleep(1)
sleep(2)
sleep(4)
sleep(8)
sleep(0.5)
sleep(1)
sleep(2)
sleep(4)
sleep(8)
sleep(0.5)
sleep(1)
sleep(2)
sleep(4)
sleep(8)
sleep(0.5)
sleep(1)
sleep(2)
sleep(4)
sleep(8)
Time
Requests
=(
=)
=(
=(
=(
=(
=(
=)
=)
=)
=)
sleep(0.6)
sleep(1.1)
sleep(2.1)
sleep(4.1)
sleep(8.1)
sleep(0.7)
sleep(1.2)
sleep(2.2)
sleep(4.2)
sleep(8.2)
sleep(0.8)
sleep(1.3)
sleep(2.3)
sleep(4.3)
sleep(8.3)
sleep(0.9)
sleep(1.4)
sleep(2.4)
sleep(4.4)
sleep(8.4)
Add jitter!
Time
Requests
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
=)
$ npm install retry-cli
$ retry –-retries=3 
--factor=2 
--randomize -- 
curl --connect-timeout 10 
https://checkip.amazonaws.com
$ npm install retry-cli
$ retry –-retries=3 
--factor=2 
--randomize -- 
curl --connect-timeout 10 
https://checkip.amazonaws.com
Retry
Exponential Backoff
Backoff Jitter
Timeout
Retry
#Hopperx1Seattle
Timeout Backoff
Don’t Let Clients Get You Down
Thank you!
#Hopperx1Seattle

Contenu connexe

Dernier

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Hopperx1 Seattle 2019 - Don't Let Clients Get You Down

Notes de l'éditeur

  1. Intro: I’m Clare Why do clients matter to resiliency?
  2. Example multi-tier system with microservices
  3. There are lots of clients in this system
  4. Drill into service: load balancer + multiple servers
  5. What happens when a single server has problems?
  6. Hopefully something like health checks realizes its down and removes it from load balancer
  7. BUT until then... clients are still going to that server!
  8. And the failure cascades all the way up the system! So, how can we configure clients to be resilient to failures, so that our entire system is resilient?
  9. Today we’ll talk about three important aspects of client resiliency
  10. Let’s start with retries
  11. Retries are self-explanatory
  12. Retrying likely gets request directed to healthy node
  13. Real world example: Installing npm modules during a cron job
  14. Enable retries in SSH
  15. Set retry limits (3-5), don’t make a bad situation worse
  16. What happens when an API doesn’t de-duplicate requests?
  17. For example, if a network connection drops, you don’t have confirmation of whether the request is still alive on that server
  18. The servers may have just been processing requests slowly, but eventually complete them. Idempotent APIs will have a field like “idempotency token” or “retry token” where you can provide a token that signifies only ONE request with this token should be processed.
  19. Timeouts give opportunity to retry in case of networking or load problems where requests are very slow. Timeouts also ensure slow requests don't hog all your threads
  20. Lots of different types of timeouts, varies by client library how much control you get over each of these
  21. Favorite is socket read timeout: many systems have a default timeout of infinity (FOREVER!). Can result in hung threads that stack up over time
  22. Real world example: curl script would randomly hang forever
  23. Configure timeouts and retries
  24. Too many retries can get you throttled, so backoff lets you retry only the number of times you need to
  25. Simplest backoff, so you’re not hammering the servers
  26. Better: exponential backoff: delay more every time you retry
  27. What happens if every client backs off the same amount?
  28. They all cause high load at the same time
  29. Add jitter: each client randomizes the amount they delay a little bit
  30. Smoothes out the request load
  31. Use retry-cli to get exponential backoff + randomized delay (i.e. jitter)
  32. Use retry-cli to get exponential backoff + randomized delay (i.e. jitter)
  33. We’ve covered retries, timeouts, and backoffs. Go inspect your clients!
  34. Questions?