SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
Balancing your latency budget
Ori Pekelman
CPO @platformsh
oripekelman everywhere github/linked-in/twitter
A model of latency
will make you
money.
What is a latency budget?
Latency is
non-productive
time.
What is a latency budget?
What is a latency budget?
SYSTEM DOING
SOMETHING
SYSTEM WAITING ON
SOME OTHER SYSTEM
DOING SOMETHING
THAT MIGHT BE
USEFUL
USER WAITING FOR
RESPONSE FROM
SYSTEM
API CALL
What is a latency budget?
SYSTEM DOING
SOMETHING
SYSTEM WAITING ON
SOME OTHER SYSTEM
DOING SOMETHING
THAT MIGHT BE
USEFUL
USER WAITING FOR
RESPONSE FROM
SYSTEM
Facts of life?
API CALL
What is a latency budget?
SYSTEM DOING
SOMETHING
SYSTEM WAITING ON
SOME OTHER SYSTEM
DOING SOMETHING
THAT MIGHT BE
USEFUL
USER WAITING FOR
RESPONSE FROM
SYSTEM
Grbll, but
maybe have to
live with it?
API CALL
What is a latency budget?
SYSTEM DOING
SOMETHING
SYSTEM WAITING ON
SOME OTHER SYSTEM
DOING SOMETHING
THAT MIGHT BE
USEFUL
USER WAITING FOR
RESPONSE FROM
SYSTEM
Grbll, but
physics?
API CALL
Whatever your
system does that is
actually useful is
not latency.
What is a latency budget?
You can not beat
physics. But you
can take it into
account.
What is a latency budget?
What is a latency budget?
1. The speed of light is 299,792 km/s
2. Around 200,000 km/s in fiber
3. Places on earth can be 20000 km apart
4. Fibers don’t actually go in straight lines
5. TCP requires a roundtrip.
6. TLS Handshake requires 2 extra roundtrips.
7. Paris is 9000 kms from San Francisco
Fighting with physics
Paris is at 130ms
TTFB from San
Francisco.
What is a latency budget?Fighting with physics
Non-Negotiable.
What is a latency budget?Fighting with physics
Unless … ?
What is a latency budget?Fighting with physics
What is a latency budget?FLAME GRAPHS ARE VISUALLY
PLEASING
What is a latency budget?AND THE EQUIVALENT OF GOING
DOWN A RABBIT HOLE
AND THE EQUIVALENT OF GOING
DOWN A RABBIT HOLE
This
.. is
this
And
this
… is
this
FLAME GRAPHS HELP US
OPTIMIZE WHAT IS SLOW
BECAUSE LATENCY IS A
RUSSIAN DOLL
But, let’s simplify
What is a latency budget?
SYSTEM DOING
SOMETHING
SYSTEM WAITING ON
SOME OTHER SYSTEM
DOING SOMETHING
THAT MIGHT BE
USEFUL
USER WAITING FOR
RESPONSE FROM
SYSTEM
API CALL
What is a latency budget?
System boundary (LB)
API CALL
Edge
API
Network
Latency
Network
Latency
Network
Latency
Network
Latency
Very small
Network
Latency
SYSTEM DOING
SOMETHING
USEFUL
The user waits this
What is a latency budget?
1. Physics
2. Robustness (remember the “very small
network latency”)?
Stuff that goes in a latency budget
What is a latency budget?
System boundary (LB)
API CALL
Edge
API
Network
Latency
Network
Latency
Network
Latency
Network
Latency
Very small
Network
Latency
SYSTEM DOING
SOMETHING
USEFUL
The user waits this
What is a latency budget?
I. Writes are more valuable than reads.
II. Some writes change the world and the world
is slow.
POSTULATES
If your API makes you get food it better be slow
because fast-food is bad for you.
What is a latency budget?A WORLD CHANGING WRITE
In our case probably the most valuable write
would be:
What is a latency budget?A WORLD CHANGING WRITE
$ curl -X POST
https://api.platform.sh/projects/jeh
oi1h/environments/staging/merge -H
'authorization: Bearer 60...fg1d'
Which means put staging into production, go
live!
What is a latency budget?A WORLD CHANGING WRITE
$ curl -X POST
https://api.platform.sh/projects/jeh
oi1h/environments/staging/merge -H
'authorization: Bearer 60...fg1d'
Which means put staging into production, go
live! (On Friday).
What is a latency budget?A WORLD CHANGING WRITE
$ curl -X POST
https://api.platform.sh/projects/jeh
oi1h/environments/staging/merge -H
'authorization: Bearer 60...fg1d'
What is a latency budget?
System boundary (LB)
API CALL
Edge
API
Network
Latency
Network
Latency
Network
Latency
Network
Latency
Very small
Network
Latency
SYSTEM DOING
SOMETHING
USEFUL
The user waits this
What is a latency budget?
System boundary (LB)
API CALL
Edge
API
Network
Latency
Network
Latency
Network
Latency
Network
Latency
Very small
Network
Latency
SYSTEM DOING
SOMETHING
SLOW
The user waits this
What is a latency budget?
We are fast. But deploying a new cluster can
take anywhere between 30 seconds and a couple
of minutes.
A backup can take a few minutes up until it is
safely stored remotely.
LATENCY TOLERANCE IS
RELATIVE TO VALUE
What is a latency budget?
SOME DATA MUST STAY COHESIVE
1. Because the co-localisation of data and
processing is an invariant. Not going away.
Because Physics.
2. Because compliance; Data-localisation is
important;
3. Because git is already distributed and it
makes no sense, no sense at all to distribute
the authority that will control your
deployment
ONE MORE POSTULATE
What is a latency budget?YOUR GIT CONTAINER IS GOING
TO BE SOMEWHERE
SYSTEM DOING
SOMETHING
SLOW, FAR AWAY
But your developers may be everywhere… so how do
we beat physics?
-H 'authorization: Bearer
60...fg1d'
What is a latency budget?POLITESSE OBLIGE: SAYING NO
SHOULD BE FAST
Remember that bit from our very valuable API call
Verifying a token is something you can do at the
edge. Saying No can be done close to the client. (You
still need to distribute secrets, so non-trivial).
What is a latency budget?POLITESSE OBLIGE: SAYING NO
SHOULD BE FAST
Remember that bit about trading a bit of latency for
robustness?
Adding yet another HTTP server, really close to the
client adds a probably unnoticeable amount of
latency in the worst case scenario, but already allows
you to say NO, really fast.
Also incredibly fast TTFB. 4ms is nicer than 130ms.
What is a latency budget?
System boundary (LB)
API CALL
Edge
API
Network
Latency
Network
Latency
Network
Latency
Network
Latency
Very small
Network
Latency
SYSTEM DOING
SOMETHING
USEFUL
The user waits this
What is a latency budget?POLITESSE OBLIGE: SAYING NO
SHOULD BE FAST
Your edge can be a full-blown API gateway. Some
Lambda/Functions. Or a CDN. You will find a bunch
of vendors around that will be more than happy to
extol the virtues of theirs...
Your API does not deliver value equally across
the board.
In our very useful API method we can already
say no quickly.
But saying yes is also something that we
accelerate through decoupling.
What is a latency budget?Why model latency?
Interestingly enough `git merge` in our world
means:
● The world is in State A. It should be in State B.
● Please make the necessary arrangements.
A slow answer from our API would be “200 OK”
A better answer is “202 Accepted”.
What is a latency budget?YES IS QUICK WHEN YES IS MAYBE
What is a latency budget?
System
boundary
(LB)
API CALL
Edge
API
Network
Latency
Network
Latency
Very small
Network
Latency
The user waits this
Euphemistically 202 is “non-commital”. But that
was a damn commit we sent there...
What is a latency budget?BUT HOW WOULD I KNOW IF
EVRERYTHING WENT FINE?
$ curl
https://api.platform.sh/projects/jeh
oi1h/environments/master/subscribe
What is a latency budget?
System
boundary
(LB)
API CALL
Edge
API
Network
Latency
Network
Latency
Very small
Network
Latency
The user waits no longer
We can subscribe to the answer before we start
the request …
We just beat physics.
What is a latency budget?BUT HOW WOULD I KNOW IF
EVRERYTHING WENT FINE?
Latency is part of
user-centric API
Design
What is a latency budget?
Project to the edge.
Use event streams
for responses.
Slow is valuable.
What is a latency budget?
And BTW for those that were here
for the previous talk… In
Platform.sh a Single API Call gives
you a fully consistent backup of all
of your microservices and their
backends. Even if some say physics
say we can’t.
What is a latency budget?
Balancing your latency budget
Ori Pekelman
CPO @platformsh
oripekelman everywhere github/linked-in/twitter

Weitere ähnliche Inhalte

Kürzlich hochgeladen

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
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-...Steffen Staab
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
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 CCTVshikhaohhpro
 
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 WorkerThousandEyes
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
+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
 
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 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 

Kürzlich hochgeladen (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
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-...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
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
 
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
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
+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...
 
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 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

Empfohlen

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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 
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...Applitools
 
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 WorkGetSmarter
 

Empfohlen (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
 

API Days 2018 balance your latency budget

  • 1.
  • 2. Balancing your latency budget Ori Pekelman CPO @platformsh oripekelman everywhere github/linked-in/twitter
  • 3. A model of latency will make you money. What is a latency budget?
  • 5. What is a latency budget? SYSTEM DOING SOMETHING SYSTEM WAITING ON SOME OTHER SYSTEM DOING SOMETHING THAT MIGHT BE USEFUL USER WAITING FOR RESPONSE FROM SYSTEM API CALL
  • 6. What is a latency budget? SYSTEM DOING SOMETHING SYSTEM WAITING ON SOME OTHER SYSTEM DOING SOMETHING THAT MIGHT BE USEFUL USER WAITING FOR RESPONSE FROM SYSTEM Facts of life? API CALL
  • 7. What is a latency budget? SYSTEM DOING SOMETHING SYSTEM WAITING ON SOME OTHER SYSTEM DOING SOMETHING THAT MIGHT BE USEFUL USER WAITING FOR RESPONSE FROM SYSTEM Grbll, but maybe have to live with it? API CALL
  • 8. What is a latency budget? SYSTEM DOING SOMETHING SYSTEM WAITING ON SOME OTHER SYSTEM DOING SOMETHING THAT MIGHT BE USEFUL USER WAITING FOR RESPONSE FROM SYSTEM Grbll, but physics? API CALL
  • 9. Whatever your system does that is actually useful is not latency. What is a latency budget?
  • 10. You can not beat physics. But you can take it into account. What is a latency budget?
  • 11. What is a latency budget? 1. The speed of light is 299,792 km/s 2. Around 200,000 km/s in fiber 3. Places on earth can be 20000 km apart 4. Fibers don’t actually go in straight lines 5. TCP requires a roundtrip. 6. TLS Handshake requires 2 extra roundtrips. 7. Paris is 9000 kms from San Francisco Fighting with physics
  • 12. Paris is at 130ms TTFB from San Francisco. What is a latency budget?Fighting with physics
  • 13. Non-Negotiable. What is a latency budget?Fighting with physics
  • 14. Unless … ? What is a latency budget?Fighting with physics
  • 15. What is a latency budget?FLAME GRAPHS ARE VISUALLY PLEASING
  • 16. What is a latency budget?AND THE EQUIVALENT OF GOING DOWN A RABBIT HOLE
  • 17. AND THE EQUIVALENT OF GOING DOWN A RABBIT HOLE This .. is this And this … is this
  • 18. FLAME GRAPHS HELP US OPTIMIZE WHAT IS SLOW BECAUSE LATENCY IS A RUSSIAN DOLL
  • 20. What is a latency budget? SYSTEM DOING SOMETHING SYSTEM WAITING ON SOME OTHER SYSTEM DOING SOMETHING THAT MIGHT BE USEFUL USER WAITING FOR RESPONSE FROM SYSTEM API CALL
  • 21. What is a latency budget? System boundary (LB) API CALL Edge API Network Latency Network Latency Network Latency Network Latency Very small Network Latency SYSTEM DOING SOMETHING USEFUL The user waits this
  • 22. What is a latency budget? 1. Physics 2. Robustness (remember the “very small network latency”)? Stuff that goes in a latency budget
  • 23. What is a latency budget? System boundary (LB) API CALL Edge API Network Latency Network Latency Network Latency Network Latency Very small Network Latency SYSTEM DOING SOMETHING USEFUL The user waits this
  • 24. What is a latency budget? I. Writes are more valuable than reads. II. Some writes change the world and the world is slow. POSTULATES
  • 25. If your API makes you get food it better be slow because fast-food is bad for you. What is a latency budget?A WORLD CHANGING WRITE
  • 26. In our case probably the most valuable write would be: What is a latency budget?A WORLD CHANGING WRITE $ curl -X POST https://api.platform.sh/projects/jeh oi1h/environments/staging/merge -H 'authorization: Bearer 60...fg1d'
  • 27. Which means put staging into production, go live! What is a latency budget?A WORLD CHANGING WRITE $ curl -X POST https://api.platform.sh/projects/jeh oi1h/environments/staging/merge -H 'authorization: Bearer 60...fg1d'
  • 28. Which means put staging into production, go live! (On Friday). What is a latency budget?A WORLD CHANGING WRITE $ curl -X POST https://api.platform.sh/projects/jeh oi1h/environments/staging/merge -H 'authorization: Bearer 60...fg1d'
  • 29. What is a latency budget? System boundary (LB) API CALL Edge API Network Latency Network Latency Network Latency Network Latency Very small Network Latency SYSTEM DOING SOMETHING USEFUL The user waits this
  • 30. What is a latency budget? System boundary (LB) API CALL Edge API Network Latency Network Latency Network Latency Network Latency Very small Network Latency SYSTEM DOING SOMETHING SLOW The user waits this
  • 31. What is a latency budget? We are fast. But deploying a new cluster can take anywhere between 30 seconds and a couple of minutes. A backup can take a few minutes up until it is safely stored remotely. LATENCY TOLERANCE IS RELATIVE TO VALUE
  • 32. What is a latency budget? SOME DATA MUST STAY COHESIVE 1. Because the co-localisation of data and processing is an invariant. Not going away. Because Physics. 2. Because compliance; Data-localisation is important; 3. Because git is already distributed and it makes no sense, no sense at all to distribute the authority that will control your deployment ONE MORE POSTULATE
  • 33. What is a latency budget?YOUR GIT CONTAINER IS GOING TO BE SOMEWHERE SYSTEM DOING SOMETHING SLOW, FAR AWAY But your developers may be everywhere… so how do we beat physics?
  • 34. -H 'authorization: Bearer 60...fg1d' What is a latency budget?POLITESSE OBLIGE: SAYING NO SHOULD BE FAST Remember that bit from our very valuable API call Verifying a token is something you can do at the edge. Saying No can be done close to the client. (You still need to distribute secrets, so non-trivial).
  • 35. What is a latency budget?POLITESSE OBLIGE: SAYING NO SHOULD BE FAST Remember that bit about trading a bit of latency for robustness? Adding yet another HTTP server, really close to the client adds a probably unnoticeable amount of latency in the worst case scenario, but already allows you to say NO, really fast. Also incredibly fast TTFB. 4ms is nicer than 130ms.
  • 36. What is a latency budget? System boundary (LB) API CALL Edge API Network Latency Network Latency Network Latency Network Latency Very small Network Latency SYSTEM DOING SOMETHING USEFUL The user waits this
  • 37. What is a latency budget?POLITESSE OBLIGE: SAYING NO SHOULD BE FAST Your edge can be a full-blown API gateway. Some Lambda/Functions. Or a CDN. You will find a bunch of vendors around that will be more than happy to extol the virtues of theirs...
  • 38. Your API does not deliver value equally across the board. In our very useful API method we can already say no quickly. But saying yes is also something that we accelerate through decoupling. What is a latency budget?Why model latency?
  • 39. Interestingly enough `git merge` in our world means: ● The world is in State A. It should be in State B. ● Please make the necessary arrangements. A slow answer from our API would be “200 OK” A better answer is “202 Accepted”. What is a latency budget?YES IS QUICK WHEN YES IS MAYBE
  • 40. What is a latency budget? System boundary (LB) API CALL Edge API Network Latency Network Latency Very small Network Latency The user waits this
  • 41. Euphemistically 202 is “non-commital”. But that was a damn commit we sent there... What is a latency budget?BUT HOW WOULD I KNOW IF EVRERYTHING WENT FINE? $ curl https://api.platform.sh/projects/jeh oi1h/environments/master/subscribe
  • 42. What is a latency budget? System boundary (LB) API CALL Edge API Network Latency Network Latency Very small Network Latency The user waits no longer
  • 43. We can subscribe to the answer before we start the request … We just beat physics. What is a latency budget?BUT HOW WOULD I KNOW IF EVRERYTHING WENT FINE?
  • 44. Latency is part of user-centric API Design What is a latency budget?
  • 45. Project to the edge. Use event streams for responses. Slow is valuable. What is a latency budget?
  • 46. And BTW for those that were here for the previous talk… In Platform.sh a Single API Call gives you a fully consistent backup of all of your microservices and their backends. Even if some say physics say we can’t. What is a latency budget?
  • 47. Balancing your latency budget Ori Pekelman CPO @platformsh oripekelman everywhere github/linked-in/twitter