SlideShare uma empresa Scribd logo
1 de 54
Baixar para ler offline
Load balancing
theory and practice
Welcome
Me:
• Dave Rosenthal
• Co-founder of FoundationDB
• Spent last three years building a distributed
  transactional NoSQL database
• It’s my birthday

Any time you have multiple computers working on a
      job, you have a load balancing problem!
Warning
There is an ugly downside to learning about load
balancing: TSA checkpoints, grocery store lines,
and traffic lights may become even more
frustrating.
What is load balancing?
Wikipedia: “…methodology to distribute
workload across multiple computers … to
achieve optimal resource utilization, maximize
throughput, minimize response time, and avoid
overload”

          All part of the latency curve
The latency curve
                                           Overload
          10000


          1000
                                            Saturation
Latency




            100


             10


              1    Nominal                 Interesting

                             Jobs/second
Goal for real-time systems

          10000


          1000
Latency




            100

                  Low latency at
             10   given load

              1


                               Jobs/second
Goal for batch systems

          10000


          1000
                    High Jobs/sec at a
Latency




            100     reasonable latency


             10


              1


                        Jobs/second
The latency curve
               1000



               100
Latency (ms)




                              Better load balancing strategies
                              can dramatically improve both
                              latency and throughput
                 10



                  1
                      0     0.2       0.4          0.6      0.8   1
                                            Load
Load balancing tensions
• We want to reduce queue lengths in the
  system to yield better latency
• We want to lengthen queue lengths to keep a
  “buffer” of work to keep busy during irregular
  traffic and yield better throughput
• For distributed systems, equalizing queue
  lengths sounds good
Can we just limit queue sizes?
                    40
                    35
                    30
% of dropped jobs




                    25
                    20
                    15
                    10
                    5
                    0
                         0   5          10           15   20
                                  Queued job limit
Simple strategies
Global job queue: for slow tasks
Round robin: for highly uniform situations
Random: probably won’t screw you
Sticky: for cacheable situations
Fastest of N tries: tradeoff throughput for
latency. I recommend N = 2 or 3.
Use a global queue if possible
                         10
Latency under 80% load




                          1
                                                                               Random assignment
                                                                               Global Job Queue



                         0.1
                               1   2   3   4     5     6      7   8   9   10
                                               Cluster Size
Options for information transfer
•   None (rare)
•   Latency (most common)
•   Failure detection
•   Explicit
    – Load average
    – Queue length
    – Response times
FoundationDB’s approach
1. Request to random of three servers
2. Server either answers query or replies “busy” if its
   queue is longer than the queue limit estimate
3. Queries that were busy are sent to second random
   server with “must do” flag set.

Queue limit = 25 * 2^(20*P)
• A global queue limit is implicitly shared by estimating
  the fraction of incoming requests (P) that are flagged
  “must do”
• Converges to a P(redirect)/queue-size equilibrium
FDB latency curve before/after
          100




          10
Latency




            1




          0.1
                0   200000   400000    600000    800000   1000000   1200000
                                Operations per second
Tackling load balancing
•   Queuing theory: One useful insight
•   Simulation: Do this
•   Instrumentation: Do this
•   Control theory: Know how to avoid this
•   Operations research: Read about this for fun
    – Blackett: Shield planes where they are not shot!
The one insight: Little’s law
                       Q = R*W

•   (Q)ueue size = (R)ate * (W)ait-time
•   Q is the average number of jobs in the system
•   R is the average arrival rate (jobs/second)
•   W is the average wait time (seconds)
•   For any (!) steady-state systems
    – Or sub-systems, or joint systems, or…
Little’s law example 1
                     Q = R*W

•   We get 1,000,000 request per second (R=1E6)
•   We take 100 ms to service each request
•   (Q = 1E6*0.100)
•   Little’s Law: Average queue depth is 100,000!
Little’s law example 2
                   W = Q/R

• We have 100 users in the system making
  continuous requests (Q=100)
• We get 10,000 requests per second
• (W = 100 / 10,000)
• Little’s Law: Average wait time is 10 ms
Little’s law ramifications
                     Q = R*W

• In distributed system:
  – R scales up
  – W remains the same, or gets a bit worse
• To maintain performance, you’re going to
  need a whole lot of jobs in flight
The rest of queuing theory
Erlang
• A language
• A man (Agner Krarup Erlang)
• And a unit! (Q from little’s law AKA offered load is
  measured in dimensionless Erlang units)
• Erlang-B formula (for limited-length queues)
• Erlang-C formula (P(waiting))
Abandon hope

                             Math for queuing theory
                     10000
Complexity of Math




                     1000

                       100

                        10

                         1
                                        Little’s law


                                    Real-world applicability
                                                               ?
Simulation
The best way to explore distributed system
behavior
Quiz
Model: Jobs of random durations. 80% load.
Goal: Minimize average job latency.

What to work a bit more on?
• First task received
• Last task received
• Shortest task
• Longest task
• Random task
• Task with least work remaining
• Task with most work remaining
Simulation code snippits
Simulation results at 80% load
            First task received

            Last task received

                 Shortest task

                 Longest task

                 Random task

Task with least work remaining

Task with most work remaining

                                  0   10   20     30   40   50
                                            Latency
Simulation results at 95% load
            First task received

            Last task received

                 Shortest task

                 Longest task

                 Random task

Task with least work remaining

Task with most work remaining

                                  1   10   100    1000   10000   100000
                                             Latency
FoundationDB’s approach
• Strategy validated using simulation used for a
  single server’s fiber scheduling
• High priority: Work on the next task to finish
• But be careful to enqueue incoming work
  from the network with highest priority—we
  want to know about all our jobs to make good
  decisions
• Low priority: Catch up with housekeeping (e.g.
  non-log writing)
Load spikes
Low load system               High load system




  Bursts of job requests can destroy latency. The
  effect is quadratic: A burst produces a queue of
  size B that lasts time proportional to B. On highly-
  loaded systems, the effect is multiplied by 1/(1-
  load), leading to huge latency impacts.
Burst-avoiding tip
1. Search for any delay/interval in your system
2. If system correctness depends on the
   delay/interval being exact, first fix that
3. Now change that delay/interval to randomly
   wait 0.8-1.2 times the nominal time on each
   execution

YMMV, but this tends to diffuse system events more
  evenly in time and help utilization and latency.
Overload
                                 Overload
          10000


          1000
Latency




            100


             10


              1


                   Jobs/second
Overload
What happens when work comes in too fast?
• Somewhere in your system a queue is going to
  get huge. Where?
• Lowered efficiency due to:
  – Sloshing
  – Poor caching
• Unconditional acceptance of new work means
  no information transfer to previous system!
Overload (cont’d): Sloshing
Loading 10 million rows into popular NoSQL K/V
store shows sloshing

                   12.5 minutes
Overload (cont’d): No sloshing
Loading 10 million rows into FDB shows smooth
behavior:
System queuing

       Queue    Queue    Queue




Work
 A
 B
 C     Node 1   Node 2   Node 3
 D
 E
System queuing

       Queue    Queue    Queue
         A




Work


 B
 C     Node 1   Node 2   Node 3
 D
 E
Internal queue buildup

          Queue   Queue    Queue
           A
           B
            C

Work       D




         Node 1   Node 2   Node 3

 E
Even queues, external buildup

           Queue    Queue    Queue
                               A
                      B
             C

Work




           Node 1   Node 2   Node 3
 D
 E
 …
Our approach
“Ratekeeper”
• Active management of internal queue sizes
  prevents sloshing
• Avoids every subcomponent needing it’s own
  well-tuned load balancing strategy
• Explicitly send queue information at 10hz back to
  a centrally-elected control algorithm
• When queues get large, slow system input
• Pushes latency into an external queue at the
  front of the system using “tickets”
Ratekeeper in action
                        1400000

                        1200000
Operations per second




                        1000000

                        800000

                        600000

                        400000

                        200000

                              0
                                  0     100   200    300      400   500   600
                                                    Seconds
Ratekeeper internals
What can go wrong
Well, we are controlling the queue depths of the
system, so, basically, everything in control
theory…



Namely, oscillation:
Recognizing oscillation
• Something moving up and down :)
  – Look for low utilization of parallel resources
  – Zoom in!
• Think about sources of feedback—is there
  some way that having a machine getting more
  job done feeds either less or more work for
  that machine in the future? (probably yes)
What oscillation looks like
                70

                60

                50
Utilization %




                40
                                                       Node A
                30
                                                       Node B
                20

                10

                0
                     1        2      3      4     5
What oscillation looks like
                120

                100

                80
Utilization %




                60
                                                                    Node A
                                                                    Node B
                40

                20

                 0
                      2      2.05   2.1   2.15   2.2   2.25   2.3
                -20
Avoiding oscillation
• This is control theory—avoid if possible!
• The major thing to know: control gets harder
  at frequencies get higher. (e.g. Bose
  headphones)
• Two strategies:
  – Control on a longer time scale
  – Introduce a low-pass-filer in the control loop (e.g.
    exponential moving average)
Instrumentation
 If you can’t measure, you can’t make it better

Things that might be nice to measure:
• Latencies
• Queue lengths
• Causes of latency?
Measuring latencies
Our approach:
• We want information about the distribution, not
  just the average
• We use a “Distribution” class
  – addSample(X)
  – Stores 500+ samples
  – Throws away half of them when it hits 1000
    samples, and halves probability of accepting new
    samples
  – Also tracks exact min, max, mean, and stddev
Measuring queue lengths
Our approach:
• Track the % of time that a queue is at zero length
• Measure queue length snapshots at intervals
• Watch out for oscillations
   – Slow ones you can see
   – Fast ones look like noise (which, unfortunately, is also
     what noise looks like)
   – “Zoom in” to exclude the possibility of micro-
     oscillations
Measuring latency from blocking
• Easy to calculate:
   – L = (b0^2 + b1^2 … bN^2) / elapsed
   – Total all squared seconds of blocking time over some
     interval, divide by the duration of the interval.
• Measures impact of unavailability on mean
  latency from random traffic
• Example: Is server’s slow latency explained by
  this lock?
• Doesn’t count catch-up time.
Summary
Thanks for listening, and remember:
• Everything has a latency curve
• Little’s law
• Randomize regular intervals
• Validate designs with simulation
• Instrument

     May your queues be small, but not empty
david.rosenthal@foundationdb.com
Prioritization/QOS
• Can help in systems under partial load
• Vital in systems that handle batch and real-
  time loads simultaneously
• Be careful that high priority work doesn’t
  generate other high priority work plus other
  jobs in the queue. This can lead to poor
  utilization analogous to the internal queue
  buildup case.
Congestion pricing
• My favorite topic
• Priority isn’t just a function of the benefit of
  your job
• To be a good citizen, you should subtract the
  costs to others
• For example, jumping into the front of a long
  queue has costs proportional to the queue
  size
Other FIFO alternatives?
• LIFO
  – Avoids the reason to line up early
  – In situations where there is adequate capacity to
    serve everyone, can yield better waiting times for
    everyone involved

Mais conteúdo relacionado

Mais procurados

Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Ji-Woong Choi
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerSmartBear
 
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...HostedbyConfluent
 
Using hilt in a modularized project
Using hilt in a modularized projectUsing hilt in a modularized project
Using hilt in a modularized projectFabio Collini
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub ActionsKnoldus Inc.
 
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless OverviewOpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless OverviewMaría Angélica Bracho
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and GroovyClaus Ibsen
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkTimothy Spann
 
Prometheus (Prometheus London, 2016)
Prometheus (Prometheus London, 2016)Prometheus (Prometheus London, 2016)
Prometheus (Prometheus London, 2016)Brian Brazil
 
Collecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDCollecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDitnig
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to PrometheusJulien Pivotto
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive ProgrammingStéphane Maldini
 
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)Hyunmin Lee
 
Velocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ NetflixVelocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ Netflixaspyker
 
Creating and Managing a WordPress Website with Amazon Lightsail - AWS Online ...
Creating and Managing a WordPress Website with Amazon Lightsail - AWS Online ...Creating and Managing a WordPress Website with Amazon Lightsail - AWS Online ...
Creating and Managing a WordPress Website with Amazon Lightsail - AWS Online ...Amazon Web Services
 

Mais procurados (20)

Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of Swagger
 
Logging with log4j v1.2
Logging with log4j v1.2Logging with log4j v1.2
Logging with log4j v1.2
 
HAProxy 1.9
HAProxy 1.9HAProxy 1.9
HAProxy 1.9
 
Java On CRaC
Java On CRaCJava On CRaC
Java On CRaC
 
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
 
Using hilt in a modularized project
Using hilt in a modularized projectUsing hilt in a modularized project
Using hilt in a modularized project
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless OverviewOpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and FlinkDBA Fundamentals Group: Continuous SQL with Kafka and Flink
DBA Fundamentals Group: Continuous SQL with Kafka and Flink
 
Prometheus (Prometheus London, 2016)
Prometheus (Prometheus London, 2016)Prometheus (Prometheus London, 2016)
Prometheus (Prometheus London, 2016)
 
Kong Workshop.pdf
Kong Workshop.pdfKong Workshop.pdf
Kong Workshop.pdf
 
Collecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDCollecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsD
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to Prometheus
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive Programming
 
Edge architecture ieee international conference on cloud engineering
Edge architecture   ieee international conference on cloud engineeringEdge architecture   ieee international conference on cloud engineering
Edge architecture ieee international conference on cloud engineering
 
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
카프카(kafka) 성능 테스트 환경 구축 (JMeter, ELK)
 
Velocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ NetflixVelocity NYC 2016 - Containers @ Netflix
Velocity NYC 2016 - Containers @ Netflix
 
Creating and Managing a WordPress Website with Amazon Lightsail - AWS Online ...
Creating and Managing a WordPress Website with Amazon Lightsail - AWS Online ...Creating and Managing a WordPress Website with Amazon Lightsail - AWS Online ...
Creating and Managing a WordPress Website with Amazon Lightsail - AWS Online ...
 

Destaque

Deterministic simulation testing
Deterministic simulation testingDeterministic simulation testing
Deterministic simulation testingFoundationDB
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDBFoundationDB
 
My Trip Through Australia
My Trip Through AustraliaMy Trip Through Australia
My Trip Through Australiadeankathryn
 
рождественский вертеп
рождественский вертепрождественский вертеп
рождественский вертепTatiana Tretiakova
 
Estacion los angeles
Estacion los angelesEstacion los angeles
Estacion los angelesJAIME JIPSION
 
Micro-services Battle Scars
Micro-services Battle ScarsMicro-services Battle Scars
Micro-services Battle ScarsRichard Rodger
 
Design Patterns in Micro-services architectures & Gilmour
Design Patterns in Micro-services architectures & GilmourDesign Patterns in Micro-services architectures & Gilmour
Design Patterns in Micro-services architectures & GilmourPiyush Verma
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysManuel Bernhardt
 
Delivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards SophisticationDelivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards SophisticationThoughtworks
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Chris Richardson
 

Destaque (15)

Deterministic simulation testing
Deterministic simulation testingDeterministic simulation testing
Deterministic simulation testing
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDB
 
My Trip Through Australia
My Trip Through AustraliaMy Trip Through Australia
My Trip Through Australia
 
рождественский вертеп
рождественский вертепрождественский вертеп
рождественский вертеп
 
Simple past lesson
Simple past lesson Simple past lesson
Simple past lesson
 
Музей Истоки
Музей ИстокиМузей Истоки
Музей Истоки
 
Лицей
ЛицейЛицей
Лицей
 
Estacion los angeles
Estacion los angelesEstacion los angeles
Estacion los angeles
 
Micro-services Battle Scars
Micro-services Battle ScarsMicro-services Battle Scars
Micro-services Battle Scars
 
Design Patterns in Micro-services architectures & Gilmour
Design Patterns in Micro-services architectures & GilmourDesign Patterns in Micro-services architectures & Gilmour
Design Patterns in Micro-services architectures & Gilmour
 
NoSQL and ACID
NoSQL and ACIDNoSQL and ACID
NoSQL and ACID
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDays
 
Delivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards SophisticationDelivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards Sophistication
 
Process design
Process designProcess design
Process design
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...
 

Semelhante a Load balancing theory and practice

Lessons learnt on a 2000-core cluster
Lessons learnt on a 2000-core clusterLessons learnt on a 2000-core cluster
Lessons learnt on a 2000-core clusterEugene Kirpichov
 
It Probably Works
It Probably WorksIt Probably Works
It Probably WorksFastly
 
Complicating Complexity: Performance in a New Machine Age
Complicating Complexity: Performance in a New Machine AgeComplicating Complexity: Performance in a New Machine Age
Complicating Complexity: Performance in a New Machine AgeMaurice Naftalin
 
On the way to low latency
On the way to low latencyOn the way to low latency
On the way to low latencyArtem Orobets
 
Patterns of parallel programming
Patterns of parallel programmingPatterns of parallel programming
Patterns of parallel programmingAlex Tumanoff
 
Alex Smola, Professor in the Machine Learning Department, Carnegie Mellon Uni...
Alex Smola, Professor in the Machine Learning Department, Carnegie Mellon Uni...Alex Smola, Professor in the Machine Learning Department, Carnegie Mellon Uni...
Alex Smola, Professor in the Machine Learning Department, Carnegie Mellon Uni...MLconf
 
Resilience at exascale
Resilience at exascaleResilience at exascale
Resilience at exascaleMarc Snir
 
Intro to High Performance Computing in the AWS Cloud
Intro to High Performance Computing in the AWS CloudIntro to High Performance Computing in the AWS Cloud
Intro to High Performance Computing in the AWS CloudAmazon Web Services
 
On the way to low latency (2nd edition)
On the way to low latency (2nd edition)On the way to low latency (2nd edition)
On the way to low latency (2nd edition)Artem Orobets
 
Resilience at Extreme Scale
Resilience at Extreme ScaleResilience at Extreme Scale
Resilience at Extreme ScaleMarc Snir
 
Mininet: Moving Forward
Mininet: Moving ForwardMininet: Moving Forward
Mininet: Moving ForwardON.Lab
 
The Power of Determinism in Database Systems
The Power of Determinism in Database SystemsThe Power of Determinism in Database Systems
The Power of Determinism in Database SystemsDaniel Abadi
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 
Discretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSP
Discretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSPDiscretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSP
Discretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSPTathagata Das
 
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and HadoopEventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and HadoopAyon Sinha
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputPaolo Negri
 
Erlang and the Cloud: A Fractal Approach to Throughput
Erlang and the Cloud: A Fractal Approach to ThroughputErlang and the Cloud: A Fractal Approach to Throughput
Erlang and the Cloud: A Fractal Approach to ThroughputWooga
 
Erlang as a Cloud Citizen
Erlang as a Cloud CitizenErlang as a Cloud Citizen
Erlang as a Cloud CitizenWooga
 
Netflix Development Patterns for Scale, Performance & Availability (DMG206) |...
Netflix Development Patterns for Scale, Performance & Availability (DMG206) |...Netflix Development Patterns for Scale, Performance & Availability (DMG206) |...
Netflix Development Patterns for Scale, Performance & Availability (DMG206) |...Amazon Web Services
 

Semelhante a Load balancing theory and practice (20)

Lessons learnt on a 2000-core cluster
Lessons learnt on a 2000-core clusterLessons learnt on a 2000-core cluster
Lessons learnt on a 2000-core cluster
 
It Probably Works
It Probably WorksIt Probably Works
It Probably Works
 
Complicating Complexity: Performance in a New Machine Age
Complicating Complexity: Performance in a New Machine AgeComplicating Complexity: Performance in a New Machine Age
Complicating Complexity: Performance in a New Machine Age
 
On the way to low latency
On the way to low latencyOn the way to low latency
On the way to low latency
 
Patterns of parallel programming
Patterns of parallel programmingPatterns of parallel programming
Patterns of parallel programming
 
Alex Smola, Professor in the Machine Learning Department, Carnegie Mellon Uni...
Alex Smola, Professor in the Machine Learning Department, Carnegie Mellon Uni...Alex Smola, Professor in the Machine Learning Department, Carnegie Mellon Uni...
Alex Smola, Professor in the Machine Learning Department, Carnegie Mellon Uni...
 
Resilience at exascale
Resilience at exascaleResilience at exascale
Resilience at exascale
 
Intro to High Performance Computing in the AWS Cloud
Intro to High Performance Computing in the AWS CloudIntro to High Performance Computing in the AWS Cloud
Intro to High Performance Computing in the AWS Cloud
 
On the way to low latency (2nd edition)
On the way to low latency (2nd edition)On the way to low latency (2nd edition)
On the way to low latency (2nd edition)
 
Adaptive availability
Adaptive availabilityAdaptive availability
Adaptive availability
 
Resilience at Extreme Scale
Resilience at Extreme ScaleResilience at Extreme Scale
Resilience at Extreme Scale
 
Mininet: Moving Forward
Mininet: Moving ForwardMininet: Moving Forward
Mininet: Moving Forward
 
The Power of Determinism in Database Systems
The Power of Determinism in Database SystemsThe Power of Determinism in Database Systems
The Power of Determinism in Database Systems
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Discretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSP
Discretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSPDiscretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSP
Discretized Stream - Fault-Tolerant Streaming Computation at Scale - SOSP
 
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and HadoopEventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
Eventual Consistency @WalmartLabs with Kafka, Avro, SolrCloud and Hadoop
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughput
 
Erlang and the Cloud: A Fractal Approach to Throughput
Erlang and the Cloud: A Fractal Approach to ThroughputErlang and the Cloud: A Fractal Approach to Throughput
Erlang and the Cloud: A Fractal Approach to Throughput
 
Erlang as a Cloud Citizen
Erlang as a Cloud CitizenErlang as a Cloud Citizen
Erlang as a Cloud Citizen
 
Netflix Development Patterns for Scale, Performance & Availability (DMG206) |...
Netflix Development Patterns for Scale, Performance & Availability (DMG206) |...Netflix Development Patterns for Scale, Performance & Availability (DMG206) |...
Netflix Development Patterns for Scale, Performance & Availability (DMG206) |...
 

Último

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...itnewsafrica
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 

Último (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 

Load balancing theory and practice

  • 2. Welcome Me: • Dave Rosenthal • Co-founder of FoundationDB • Spent last three years building a distributed transactional NoSQL database • It’s my birthday Any time you have multiple computers working on a job, you have a load balancing problem!
  • 3. Warning There is an ugly downside to learning about load balancing: TSA checkpoints, grocery store lines, and traffic lights may become even more frustrating.
  • 4. What is load balancing? Wikipedia: “…methodology to distribute workload across multiple computers … to achieve optimal resource utilization, maximize throughput, minimize response time, and avoid overload” All part of the latency curve
  • 5. The latency curve Overload 10000 1000 Saturation Latency 100 10 1 Nominal Interesting Jobs/second
  • 6. Goal for real-time systems 10000 1000 Latency 100 Low latency at 10 given load 1 Jobs/second
  • 7. Goal for batch systems 10000 1000 High Jobs/sec at a Latency 100 reasonable latency 10 1 Jobs/second
  • 8. The latency curve 1000 100 Latency (ms) Better load balancing strategies can dramatically improve both latency and throughput 10 1 0 0.2 0.4 0.6 0.8 1 Load
  • 9. Load balancing tensions • We want to reduce queue lengths in the system to yield better latency • We want to lengthen queue lengths to keep a “buffer” of work to keep busy during irregular traffic and yield better throughput • For distributed systems, equalizing queue lengths sounds good
  • 10. Can we just limit queue sizes? 40 35 30 % of dropped jobs 25 20 15 10 5 0 0 5 10 15 20 Queued job limit
  • 11. Simple strategies Global job queue: for slow tasks Round robin: for highly uniform situations Random: probably won’t screw you Sticky: for cacheable situations Fastest of N tries: tradeoff throughput for latency. I recommend N = 2 or 3.
  • 12. Use a global queue if possible 10 Latency under 80% load 1 Random assignment Global Job Queue 0.1 1 2 3 4 5 6 7 8 9 10 Cluster Size
  • 13. Options for information transfer • None (rare) • Latency (most common) • Failure detection • Explicit – Load average – Queue length – Response times
  • 14. FoundationDB’s approach 1. Request to random of three servers 2. Server either answers query or replies “busy” if its queue is longer than the queue limit estimate 3. Queries that were busy are sent to second random server with “must do” flag set. Queue limit = 25 * 2^(20*P) • A global queue limit is implicitly shared by estimating the fraction of incoming requests (P) that are flagged “must do” • Converges to a P(redirect)/queue-size equilibrium
  • 15. FDB latency curve before/after 100 10 Latency 1 0.1 0 200000 400000 600000 800000 1000000 1200000 Operations per second
  • 16. Tackling load balancing • Queuing theory: One useful insight • Simulation: Do this • Instrumentation: Do this • Control theory: Know how to avoid this • Operations research: Read about this for fun – Blackett: Shield planes where they are not shot!
  • 17. The one insight: Little’s law Q = R*W • (Q)ueue size = (R)ate * (W)ait-time • Q is the average number of jobs in the system • R is the average arrival rate (jobs/second) • W is the average wait time (seconds) • For any (!) steady-state systems – Or sub-systems, or joint systems, or…
  • 18. Little’s law example 1 Q = R*W • We get 1,000,000 request per second (R=1E6) • We take 100 ms to service each request • (Q = 1E6*0.100) • Little’s Law: Average queue depth is 100,000!
  • 19. Little’s law example 2 W = Q/R • We have 100 users in the system making continuous requests (Q=100) • We get 10,000 requests per second • (W = 100 / 10,000) • Little’s Law: Average wait time is 10 ms
  • 20. Little’s law ramifications Q = R*W • In distributed system: – R scales up – W remains the same, or gets a bit worse • To maintain performance, you’re going to need a whole lot of jobs in flight
  • 21. The rest of queuing theory Erlang • A language • A man (Agner Krarup Erlang) • And a unit! (Q from little’s law AKA offered load is measured in dimensionless Erlang units) • Erlang-B formula (for limited-length queues) • Erlang-C formula (P(waiting))
  • 22. Abandon hope Math for queuing theory 10000 Complexity of Math 1000 100 10 1 Little’s law Real-world applicability ?
  • 23. Simulation The best way to explore distributed system behavior
  • 24. Quiz Model: Jobs of random durations. 80% load. Goal: Minimize average job latency. What to work a bit more on? • First task received • Last task received • Shortest task • Longest task • Random task • Task with least work remaining • Task with most work remaining
  • 26. Simulation results at 80% load First task received Last task received Shortest task Longest task Random task Task with least work remaining Task with most work remaining 0 10 20 30 40 50 Latency
  • 27. Simulation results at 95% load First task received Last task received Shortest task Longest task Random task Task with least work remaining Task with most work remaining 1 10 100 1000 10000 100000 Latency
  • 28. FoundationDB’s approach • Strategy validated using simulation used for a single server’s fiber scheduling • High priority: Work on the next task to finish • But be careful to enqueue incoming work from the network with highest priority—we want to know about all our jobs to make good decisions • Low priority: Catch up with housekeeping (e.g. non-log writing)
  • 29. Load spikes Low load system High load system Bursts of job requests can destroy latency. The effect is quadratic: A burst produces a queue of size B that lasts time proportional to B. On highly- loaded systems, the effect is multiplied by 1/(1- load), leading to huge latency impacts.
  • 30. Burst-avoiding tip 1. Search for any delay/interval in your system 2. If system correctness depends on the delay/interval being exact, first fix that 3. Now change that delay/interval to randomly wait 0.8-1.2 times the nominal time on each execution YMMV, but this tends to diffuse system events more evenly in time and help utilization and latency.
  • 31. Overload Overload 10000 1000 Latency 100 10 1 Jobs/second
  • 32. Overload What happens when work comes in too fast? • Somewhere in your system a queue is going to get huge. Where? • Lowered efficiency due to: – Sloshing – Poor caching • Unconditional acceptance of new work means no information transfer to previous system!
  • 33. Overload (cont’d): Sloshing Loading 10 million rows into popular NoSQL K/V store shows sloshing 12.5 minutes
  • 34. Overload (cont’d): No sloshing Loading 10 million rows into FDB shows smooth behavior:
  • 35. System queuing Queue Queue Queue Work A B C Node 1 Node 2 Node 3 D E
  • 36. System queuing Queue Queue Queue A Work B C Node 1 Node 2 Node 3 D E
  • 37. Internal queue buildup Queue Queue Queue A B C Work D Node 1 Node 2 Node 3 E
  • 38. Even queues, external buildup Queue Queue Queue A B C Work Node 1 Node 2 Node 3 D E …
  • 39. Our approach “Ratekeeper” • Active management of internal queue sizes prevents sloshing • Avoids every subcomponent needing it’s own well-tuned load balancing strategy • Explicitly send queue information at 10hz back to a centrally-elected control algorithm • When queues get large, slow system input • Pushes latency into an external queue at the front of the system using “tickets”
  • 40. Ratekeeper in action 1400000 1200000 Operations per second 1000000 800000 600000 400000 200000 0 0 100 200 300 400 500 600 Seconds
  • 42. What can go wrong Well, we are controlling the queue depths of the system, so, basically, everything in control theory… Namely, oscillation:
  • 43. Recognizing oscillation • Something moving up and down :) – Look for low utilization of parallel resources – Zoom in! • Think about sources of feedback—is there some way that having a machine getting more job done feeds either less or more work for that machine in the future? (probably yes)
  • 44. What oscillation looks like 70 60 50 Utilization % 40 Node A 30 Node B 20 10 0 1 2 3 4 5
  • 45. What oscillation looks like 120 100 80 Utilization % 60 Node A Node B 40 20 0 2 2.05 2.1 2.15 2.2 2.25 2.3 -20
  • 46. Avoiding oscillation • This is control theory—avoid if possible! • The major thing to know: control gets harder at frequencies get higher. (e.g. Bose headphones) • Two strategies: – Control on a longer time scale – Introduce a low-pass-filer in the control loop (e.g. exponential moving average)
  • 47. Instrumentation If you can’t measure, you can’t make it better Things that might be nice to measure: • Latencies • Queue lengths • Causes of latency?
  • 48. Measuring latencies Our approach: • We want information about the distribution, not just the average • We use a “Distribution” class – addSample(X) – Stores 500+ samples – Throws away half of them when it hits 1000 samples, and halves probability of accepting new samples – Also tracks exact min, max, mean, and stddev
  • 49. Measuring queue lengths Our approach: • Track the % of time that a queue is at zero length • Measure queue length snapshots at intervals • Watch out for oscillations – Slow ones you can see – Fast ones look like noise (which, unfortunately, is also what noise looks like) – “Zoom in” to exclude the possibility of micro- oscillations
  • 50. Measuring latency from blocking • Easy to calculate: – L = (b0^2 + b1^2 … bN^2) / elapsed – Total all squared seconds of blocking time over some interval, divide by the duration of the interval. • Measures impact of unavailability on mean latency from random traffic • Example: Is server’s slow latency explained by this lock? • Doesn’t count catch-up time.
  • 51. Summary Thanks for listening, and remember: • Everything has a latency curve • Little’s law • Randomize regular intervals • Validate designs with simulation • Instrument May your queues be small, but not empty david.rosenthal@foundationdb.com
  • 52. Prioritization/QOS • Can help in systems under partial load • Vital in systems that handle batch and real- time loads simultaneously • Be careful that high priority work doesn’t generate other high priority work plus other jobs in the queue. This can lead to poor utilization analogous to the internal queue buildup case.
  • 53. Congestion pricing • My favorite topic • Priority isn’t just a function of the benefit of your job • To be a good citizen, you should subtract the costs to others • For example, jumping into the front of a long queue has costs proportional to the queue size
  • 54. Other FIFO alternatives? • LIFO – Avoids the reason to line up early – In situations where there is adequate capacity to serve everyone, can yield better waiting times for everyone involved