SlideShare a Scribd company logo
Operating Systems
          CMPSCI 377
        Queuing Systems
            Emery Berger
University of Massachusetts Amherst




  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Queuing Systems & Servers
    Queuing systems


        High-level model of concurrent applications
    

    Flux


        Language for building servers
    




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   2
Queuing Networks
    Model of tasks or services


        Node includes queue (line) & server
    




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   3
Queuing Networks
    Model of tasks or services


        Node includes queue (line) & server
    




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   4
Queuing Networks
    Model of tasks or services


        Node includes queue (line) & server
    




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   5
Queuing Networks
    Model of tasks or services


        Node includes queue (line) & server
    




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   6
Queuing Networks
    Model of tasks or services


        Node includes queue (line) & server
    




    arrival rate
        ()




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   7
Queuing Networks
    Model of tasks or services


        Node includes queue (line) & server
    




                        waiting time




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   8
Queuing Networks
    Model of tasks or services


        Node includes queue (line) & server
    




                                    service time




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   9
Queuing Networks
    Model of tasks or services


        Node includes queue (line) & server
    




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   10
Stable Systems
    Stable queuing system:


    arrival rate = departure rate




      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   11
Stable Systems
    Stable queuing system:


    arrival rate = departure rate




      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   12
Stable Systems
    Stable queuing system:


    arrival rate = departure rate




      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   13
Stable Systems
    Stable queuing system:


    arrival rate = departure rate




    What happens if  > departure rate?





      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   14
Stable Systems
    Stable queuing system:


    arrival rate = departure rate




    What happens if  > departure rate?





      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   15
Stable Systems
    Stable queuing system:


    arrival rate = departure rate




    What happens if  > departure rate?





      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   16
Stable Systems
    Stable queuing system:


    arrival rate = departure rate




    What happens if  > departure rate?





      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   17
Networks of Queues
    Can build system from connected servers


        Latency = time for one thing to get through
    

        Throughput = service rate
    




        5/sec                          5/sec                              5/sec


    Throughput?


        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science      18
Networks of Queues
    Can build system with numerous


    connected servers
        Latency = time for one thing to get through
    

        Throughput = service rate
    




        5/sec                          1/sec                              5/sec

    Throughput?


        Lowest throughput = bottleneck
    

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science      19
Little’s Law
    Little’s Law – applies to any “blackbox”


    server
        Queue length (N) =
    

        arrival rate () * average waiting time (T)
              N=T
          




              N

                                      T



        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   20
Applications of Little’s Law
    Compute waiting time to get into


    restaurant, bar, etc.
        If N = 20 people in front of you,
    

         = departure rate = 1 / 5 min.,
        how long will you wait in line?



                                   N=T
             N

                                       T

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   21
Applications of Little’s Law
    Required service time?


        Arrival rate = one job @ 500 ms
    

        Average queue length = 10
    

        T=?
    

              What’s the average latency?
          




                                   N=T
              N

                                       T

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   22
Applications of Little’s Law
    Required service time?


        Arrival rate = one job @ 500 ms
    

        Average queue length = 5
    

        T=?
    

              What’s the average latency?
          




                                   N=T
              N

                                       T

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   23
Motivating Example: Image Server
                                                                       image
                                                                       server
    Client


        Requests image @ desired
    

        quality, size                                                               not found

    Server


        Images: RAW
    
                                              http://server/Easter-bunny/
                                              200x100/75
        Compresses to JPG
    

        Caches requests
    

        Sends to client
    




                                                  client
             UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Problem: Concurrency
                                                                     image
    Could write sequential code                                      server

    but…
        More clients (latency)
    

        Bigger server
    

             Multicores, multiprocessors
         


    One approach: threads


        Limit reuse,
    

        risk deadlock,
        burden programmer
        Complicate debugging
    

        Mixes program logic &
    

        concurrency control                             clients

               UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
The Flux Programming Language
        High-performance & deadlock-free
concurrent programming w/ sequential components
     Flux = Components + Flow + Atomicity
 

         Components               unmodified C, C++ (or Java)
     

         Flow                     implicitly || path thru components
     

         Atomicity                high-level mutual exclusion
     



     Compiler generates:
 

         Deadlock-free, runtime-independent server
     

              Threads, thread pools, events, …
          


         Path profiling
     

         Discrete event simulator
     

                UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Flux Outline

     Intro to Flux: building a server
 

         Components
     

         Flows
     

         Atomicity
     

     Performance results
 

         Server performance
     

         Performance prediction (QNMs)
     




         UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Flux Server “Main”

    Source nodes originate flows


        Conceptually in separate thread
    

        Executes inside implicit infinite loop
    

             Here: initiates flow for each image request
         



                  source Listen  Image;




                      Listen
                                                           image server
                                                      ReadRequest      Compress       Write     Complete
                                                       ReadRequest      Compress       Write     Complete
                                                         ReadRequest     Compress       Write     Complete




               UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Flux Image Server
     Basic image server requires:
 
        HTTP parsing (http)
      

       Socket handling (socket)

       JPEG compression (libjpeg)

       All UNIX-style C libraries

     Abstract node = flow across nodes
 
          Concrete or abstract
      



     Image = ReadRequest  Compress  Write  Complete;

     image server
                     ReadRequest            Compress              Write          Complete


                         http                libjpeg             socket            http

          UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Control Flow
    Direct flow via user-supplied predicate types


         Type test applied to output
    

              Note: no variables – dispatch on output “type”
          


         Here: cache frequently requested images
    



typedef hit TestInCache;
Handler:[_,_,hit] = ;
Handler:[_,_,_] = ReadFromDisk  Compress  StoreInCache;


                                                  hit   handler
                   ReadRequest     CheckCache                                      Write     Complete
Listen


                         handler
                                                                              StoreInCache
                                      ReadInFromDisk        Compress



                 UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Supporting Concurrency
    Many clients = concurrent flows


        Must keep cache consistent
    

    Atomicity constraints


        Same name = mutual exclusion
    

        Apply to nodes or whole flow (abstract node)
    


         atomic CheckCache                   {};
                                             {, };
         atomic Complete
         atomic StoreInCache                 {};

                                                            CheckCache hit
                                             ReadRequest                      Write      Complete
                                                              CheckCache hit     hit
                                               ReadRequest                      Write      Complete
                                                               CheckCache hit     Writehandler
                                                ReadRequest                                 Complete
                          Listen                  ReadInFromDisk     Compress       StoreInCache
                                                 ReadRequest          CheckCache      StoreInCache Write   Complete
                                                    ReadInFromDisk     Compress
                                                     ReadInFromDisk     Compress        StoreInCache

                                               handler
                                                                                                    StoreInCache
                                                              ReadInFromDisk         Compress




             UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
More Atomicity

    Reader / writer constraints


        Multiple readers or single writer (default)
    


              atomic ReadList: {listAccess?};
              atomic AddToList: {listAccess!};


    Per-session constraints


        User-supplied function ≈ hash on source
    

             Added to flow ≈ chooses from array of locks
         




             atomic AddHasChunk: {chunks(session)};
               UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Preventing Deadlock

       Naïve execution can deadlock
   



       atomic A: {z,y};                                    atomic A: {y,z};
       atomic B: {y,z};                                    atomic B: {y,z};

       Establish canonical lock order
   

            Partial order
        

            Alphabetic by name
        




            UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   33
Preventing Deadlock, II
    Harder with abstract nodes


 A = B;
 C = D;
                             A:{z}
                             A
                             A{z}
 atomic A{z};                                                                C{y}
                                                                              C
                                           B
 atomic B{y};
 atomic C{y,z};

    Solution: Elevate constraints; fixed point


 A = B;
 C = D;                      A{y,z}
                                                                                  C
 atomic A{y,z};
                                           B
 atomic B{y};
 atomic C{y,z};

           UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science       34
Handling Errors
    What if image requested doesn’t exist?


        Error = negative return value from component
    

        Remember – nodes oblivious to Flux
    

    Solution: error handlers


        Go to alternate paths on error
    

        Possible extension – can match on error paths
    


         handle error ReadInFromDisk  FourOhFour;
                                                                            hit
                                                                                  handler
                                             ReadRequest        CheckCache                   Write    Complete


                              Listen       handler
                                                                                               StoreInCache
                                                           ReadInFromDisk         Compress




                                                                                     FourOhFour


             UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Almost Complete Flux Image Server
source Listen  Image;
Image =
 ReadRequest  CheckCache  Handler  Write  Complete;
Handler[_,_,hit] = ;
Handler[_,_,_] = ReadFromDisk  Compress  StoreInCache;
atomic CheckCache:   {cacheLock};
atomic StoreInCache: {cacheLock};
atomic Complete:     {cacheLock};
handle error ReadInFromDisk  FourOhFour;
    Concise, readable expression of server logic


        No threads, etc.: simplifies programming, debugging
    

     image                                                             hit
                                                                             handler
     server                             ReadRequest        CheckCache                   Write    Complete
                     Listen
                                      handler
                                                                                          StoreInCache
                                                      ReadInFromDisk         Compress




                UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Flux Outline

     Intro to Flux: building a server
 

         Components, flow
     

         Atomicity, deadlock avoidance
     

     Performance results
 

         Server performance
     

         Performance prediction
     

     Future work
 




         UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Flux Results

        Four servers:
    
            Image server (+ libjpeg) [23 lines of Flux]
        

            Multi-player online game [54]
        

            BitTorrent (2 undergrads: 1 week!) [84]
        

            Web server (+ PHP) [36]
        


        Evaluation
    
            Benchmark: variant of SPECweb99
        

            Three different runtimes here
        

                 Thread:                  one per connection
             

                 Thread pool:             fixed max # threads
             

                 Event-driven:            helper threads for blocking calls
             


            Compared to Capriccio [SOSP03], SEDA [SOSP01]
        


            UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   38
Web Server




      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   39
Performance Prediction




 observed
parameters




             UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   40
Performance Prediction




 observed
parameters




             UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   41
The End




  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   42

More Related Content

Viewers also liked

14 queuing
14 queuing14 queuing
14 queuing
Dian Saputra
 
Types of operating system
Types of operating systemTypes of operating system
Types of operating system
Mohammad Alam
 
Queuing analysis
Queuing analysisQueuing analysis
Queuing analysis
Parthipan Parthi
 
Guide to Queuing System
Guide to Queuing SystemGuide to Queuing System
Guide to Queuing System
Elijahmar Cogollodo
 
Unit 6 input modeling problems
Unit 6 input modeling problemsUnit 6 input modeling problems
Unit 6 input modeling problems
raksharao
 
Unit 1 introduction contd
Unit 1 introduction contdUnit 1 introduction contd
Unit 1 introduction contd
raksharao
 
Chapter3 general principles of discrete event simulation
Chapter3   general principles of discrete event simulationChapter3   general principles of discrete event simulation
Chapter3 general principles of discrete event simulationDe La Salle University-Manila
 
Extend sim 01
Extend sim 01Extend sim 01
More Stochastic Simulation Examples
More Stochastic Simulation ExamplesMore Stochastic Simulation Examples
More Stochastic Simulation ExamplesStephen Gilmore
 
Queuing theory and simulation (MSOR)
Queuing theory and simulation (MSOR)Queuing theory and simulation (MSOR)
Queuing theory and simulation (MSOR)
snket
 
Discrete And Continuous Simulation
Discrete And Continuous SimulationDiscrete And Continuous Simulation
Discrete And Continuous SimulationNguyen Chien
 
New Method for Simulation Of Fractures
New Method for Simulation Of FracturesNew Method for Simulation Of Fractures
New Method for Simulation Of Fractures
david_schechter
 
Elements Of Stochastic Processes
Elements Of Stochastic ProcessesElements Of Stochastic Processes
Elements Of Stochastic ProcessesMALAKI12003
 
Unit 4 queuing models
Unit 4 queuing modelsUnit 4 queuing models
Unit 4 queuing models
raksharao
 
4 stochastic processes
4 stochastic processes4 stochastic processes
4 stochastic processes
Solo Hermelin
 
Stochastic modelling and its applications
Stochastic modelling and its applicationsStochastic modelling and its applications
Stochastic modelling and its applications
Kartavya Jain
 
Introduction to Discrete-Event Simulation Using SimPy
Introduction to Discrete-Event Simulation Using SimPyIntroduction to Discrete-Event Simulation Using SimPy
Introduction to Discrete-Event Simulation Using SimPy
pycontw
 
basics of stochastic and queueing theory
basics of stochastic and queueing theorybasics of stochastic and queueing theory
basics of stochastic and queueing theory
jyoti daddarwal
 

Viewers also liked (20)

14 queuing
14 queuing14 queuing
14 queuing
 
Types of operating system
Types of operating systemTypes of operating system
Types of operating system
 
Queuing analysis
Queuing analysisQueuing analysis
Queuing analysis
 
Guide to Queuing System
Guide to Queuing SystemGuide to Queuing System
Guide to Queuing System
 
Chapter1
Chapter1Chapter1
Chapter1
 
Unit 6 input modeling problems
Unit 6 input modeling problemsUnit 6 input modeling problems
Unit 6 input modeling problems
 
Unit 1 introduction contd
Unit 1 introduction contdUnit 1 introduction contd
Unit 1 introduction contd
 
Chapter3 general principles of discrete event simulation
Chapter3   general principles of discrete event simulationChapter3   general principles of discrete event simulation
Chapter3 general principles of discrete event simulation
 
Extend sim 01
Extend sim 01Extend sim 01
Extend sim 01
 
More Stochastic Simulation Examples
More Stochastic Simulation ExamplesMore Stochastic Simulation Examples
More Stochastic Simulation Examples
 
Queuing theory and simulation (MSOR)
Queuing theory and simulation (MSOR)Queuing theory and simulation (MSOR)
Queuing theory and simulation (MSOR)
 
Discrete And Continuous Simulation
Discrete And Continuous SimulationDiscrete And Continuous Simulation
Discrete And Continuous Simulation
 
New Method for Simulation Of Fractures
New Method for Simulation Of FracturesNew Method for Simulation Of Fractures
New Method for Simulation Of Fractures
 
Elements Of Stochastic Processes
Elements Of Stochastic ProcessesElements Of Stochastic Processes
Elements Of Stochastic Processes
 
Unit 4 queuing models
Unit 4 queuing modelsUnit 4 queuing models
Unit 4 queuing models
 
4 stochastic processes
4 stochastic processes4 stochastic processes
4 stochastic processes
 
Stochastic modelling and its applications
Stochastic modelling and its applicationsStochastic modelling and its applications
Stochastic modelling and its applications
 
Introduction to Discrete-Event Simulation Using SimPy
Introduction to Discrete-Event Simulation Using SimPyIntroduction to Discrete-Event Simulation Using SimPy
Introduction to Discrete-Event Simulation Using SimPy
 
Simulation
SimulationSimulation
Simulation
 
basics of stochastic and queueing theory
basics of stochastic and queueing theorybasics of stochastic and queueing theory
basics of stochastic and queueing theory
 

Similar to Operating Systems - Queuing Systems

Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and Threads
Emery Berger
 
Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual Memory
Emery Berger
 
Memory Management for High-Performance Applications
Memory Management for High-Performance ApplicationsMemory Management for High-Performance Applications
Memory Management for High-Performance Applications
Emery Berger
 
Asynchronous Javascript and Rich Internet Aplications
Asynchronous Javascript and Rich Internet AplicationsAsynchronous Javascript and Rich Internet Aplications
Asynchronous Javascript and Rich Internet Aplications
Subramanyan Murali
 
Reliability and clock synchronization
Reliability and clock synchronizationReliability and clock synchronization
Reliability and clock synchronization
Sri Manakula Vinayagar Engineering College
 
Lightweight Grids With Terracotta
Lightweight Grids With TerracottaLightweight Grids With Terracotta
Lightweight Grids With Terracotta
PT.JUG
 
Web 2.0 Expo Notes
Web 2.0 Expo NotesWeb 2.0 Expo Notes
Web 2.0 Expo Notes
Brian Moschel
 
“Practical DNN Quantization Techniques and Tools,” a Presentation from Facebook
“Practical DNN Quantization Techniques and Tools,” a Presentation from Facebook“Practical DNN Quantization Techniques and Tools,” a Presentation from Facebook
“Practical DNN Quantization Techniques and Tools,” a Presentation from Facebook
Edge AI and Vision Alliance
 
Netcetera Proactive Management Service
Netcetera Proactive Management ServiceNetcetera Proactive Management Service
Netcetera Proactive Management Service
Peter Skelton
 
Interpreting Performance Test Results
Interpreting Performance Test ResultsInterpreting Performance Test Results
Interpreting Performance Test Results
Eric Proegler
 
Comet: an Overview and a New Solution Called Jabbify
Comet: an Overview and a New Solution Called JabbifyComet: an Overview and a New Solution Called Jabbify
Comet: an Overview and a New Solution Called Jabbify
Brian Moschel
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Ruby
mattmatt
 
Smallsat 2021
Smallsat 2021Smallsat 2021
Smallsat 2021
klepsydratechnologie
 
XS 2008 Boston Capacity Planning
XS 2008 Boston Capacity PlanningXS 2008 Boston Capacity Planning
XS 2008 Boston Capacity Planning
The Linux Foundation
 
Giorgio Natilli - Blaze DS Connectivity Framework
Giorgio Natilli - Blaze DS Connectivity FrameworkGiorgio Natilli - Blaze DS Connectivity Framework
Giorgio Natilli - Blaze DS Connectivity Framework360|Conferences
 
saurabh soni rac
saurabh soni racsaurabh soni rac
saurabh soni rac
saurabh soni
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svenssonrajivmordani
 
Services Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 WorldServices Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 World
Lexumo
 
IEEE 2014 JAVA CLOUD COMPUTING PROJECTS Adaptive algorithm for minimizing clo...
IEEE 2014 JAVA CLOUD COMPUTING PROJECTS Adaptive algorithm for minimizing clo...IEEE 2014 JAVA CLOUD COMPUTING PROJECTS Adaptive algorithm for minimizing clo...
IEEE 2014 JAVA CLOUD COMPUTING PROJECTS Adaptive algorithm for minimizing clo...
IEEEGLOBALSOFTSTUDENTPROJECTS
 

Similar to Operating Systems - Queuing Systems (20)

Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and Threads
 
Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual Memory
 
Memory Management for High-Performance Applications
Memory Management for High-Performance ApplicationsMemory Management for High-Performance Applications
Memory Management for High-Performance Applications
 
Asynchronous Javascript and Rich Internet Aplications
Asynchronous Javascript and Rich Internet AplicationsAsynchronous Javascript and Rich Internet Aplications
Asynchronous Javascript and Rich Internet Aplications
 
Reliability and clock synchronization
Reliability and clock synchronizationReliability and clock synchronization
Reliability and clock synchronization
 
Lightweight Grids With Terracotta
Lightweight Grids With TerracottaLightweight Grids With Terracotta
Lightweight Grids With Terracotta
 
Web 2.0 Expo Notes
Web 2.0 Expo NotesWeb 2.0 Expo Notes
Web 2.0 Expo Notes
 
“Practical DNN Quantization Techniques and Tools,” a Presentation from Facebook
“Practical DNN Quantization Techniques and Tools,” a Presentation from Facebook“Practical DNN Quantization Techniques and Tools,” a Presentation from Facebook
“Practical DNN Quantization Techniques and Tools,” a Presentation from Facebook
 
Netcetera Proactive Management Service
Netcetera Proactive Management ServiceNetcetera Proactive Management Service
Netcetera Proactive Management Service
 
Interpreting Performance Test Results
Interpreting Performance Test ResultsInterpreting Performance Test Results
Interpreting Performance Test Results
 
Comet: an Overview and a New Solution Called Jabbify
Comet: an Overview and a New Solution Called JabbifyComet: an Overview and a New Solution Called Jabbify
Comet: an Overview and a New Solution Called Jabbify
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Ruby
 
Smallsat 2021
Smallsat 2021Smallsat 2021
Smallsat 2021
 
XS 2008 Boston Capacity Planning
XS 2008 Boston Capacity PlanningXS 2008 Boston Capacity Planning
XS 2008 Boston Capacity Planning
 
Giorgio Natilli - Blaze DS Connectivity Framework
Giorgio Natilli - Blaze DS Connectivity FrameworkGiorgio Natilli - Blaze DS Connectivity Framework
Giorgio Natilli - Blaze DS Connectivity Framework
 
saurabh soni rac
saurabh soni racsaurabh soni rac
saurabh soni rac
 
Rest Vs Soap Yawn2289
Rest Vs Soap Yawn2289Rest Vs Soap Yawn2289
Rest Vs Soap Yawn2289
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
 
Services Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 WorldServices Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 World
 
IEEE 2014 JAVA CLOUD COMPUTING PROJECTS Adaptive algorithm for minimizing clo...
IEEE 2014 JAVA CLOUD COMPUTING PROJECTS Adaptive algorithm for minimizing clo...IEEE 2014 JAVA CLOUD COMPUTING PROJECTS Adaptive algorithm for minimizing clo...
IEEE 2014 JAVA CLOUD COMPUTING PROJECTS Adaptive algorithm for minimizing clo...
 

More from Emery Berger

Doppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language BarrierDoppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language Barrier
Emery Berger
 
Dthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingDthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic Multithreading
Emery Berger
 
Programming with People
Programming with PeopleProgramming with People
Programming with People
Emery Berger
 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationEmery Berger
 
DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)
Emery Berger
 
Operating Systems - Advanced File Systems
Operating Systems - Advanced File SystemsOperating Systems - Advanced File Systems
Operating Systems - Advanced File SystemsEmery Berger
 
Operating Systems - File Systems
Operating Systems - File SystemsOperating Systems - File Systems
Operating Systems - File Systems
Emery Berger
 
Operating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationOperating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationEmery Berger
 
Operating Systems - Synchronization
Operating Systems - SynchronizationOperating Systems - Synchronization
Operating Systems - Synchronization
Emery Berger
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and Paging
Emery Berger
 
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsMC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
Emery Berger
 
Vam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorVam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory Allocator
Emery Berger
 
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementQuantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Emery Berger
 
Garbage Collection without Paging
Garbage Collection without PagingGarbage Collection without Paging
Garbage Collection without Paging
Emery Berger
 
DieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesDieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe Languages
Emery Berger
 
Exterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High ProbabilityExterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High Probability
Emery Berger
 
Operating Systems - Garbage Collection
Operating Systems - Garbage CollectionOperating Systems - Garbage Collection
Operating Systems - Garbage Collection
Emery Berger
 
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Emery Berger
 
Composing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap LayersComposing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap Layers
Emery Berger
 
Reconsidering Custom Memory Allocation
Reconsidering Custom Memory AllocationReconsidering Custom Memory Allocation
Reconsidering Custom Memory Allocation
Emery Berger
 

More from Emery Berger (20)

Doppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language BarrierDoppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language Barrier
 
Dthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingDthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic Multithreading
 
Programming with People
Programming with PeopleProgramming with People
Programming with People
 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance Evaluation
 
DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)
 
Operating Systems - Advanced File Systems
Operating Systems - Advanced File SystemsOperating Systems - Advanced File Systems
Operating Systems - Advanced File Systems
 
Operating Systems - File Systems
Operating Systems - File SystemsOperating Systems - File Systems
Operating Systems - File Systems
 
Operating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationOperating Systems - Advanced Synchronization
Operating Systems - Advanced Synchronization
 
Operating Systems - Synchronization
Operating Systems - SynchronizationOperating Systems - Synchronization
Operating Systems - Synchronization
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and Paging
 
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsMC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
 
Vam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorVam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory Allocator
 
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementQuantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
 
Garbage Collection without Paging
Garbage Collection without PagingGarbage Collection without Paging
Garbage Collection without Paging
 
DieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesDieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe Languages
 
Exterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High ProbabilityExterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High Probability
 
Operating Systems - Garbage Collection
Operating Systems - Garbage CollectionOperating Systems - Garbage Collection
Operating Systems - Garbage Collection
 
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
 
Composing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap LayersComposing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap Layers
 
Reconsidering Custom Memory Allocation
Reconsidering Custom Memory AllocationReconsidering Custom Memory Allocation
Reconsidering Custom Memory Allocation
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 

Operating Systems - Queuing Systems

  • 1. Operating Systems CMPSCI 377 Queuing Systems Emery Berger University of Massachusetts Amherst UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 2. Queuing Systems & Servers Queuing systems  High-level model of concurrent applications  Flux  Language for building servers  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 2
  • 3. Queuing Networks Model of tasks or services  Node includes queue (line) & server  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 3
  • 4. Queuing Networks Model of tasks or services  Node includes queue (line) & server  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 4
  • 5. Queuing Networks Model of tasks or services  Node includes queue (line) & server  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 5
  • 6. Queuing Networks Model of tasks or services  Node includes queue (line) & server  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 6
  • 7. Queuing Networks Model of tasks or services  Node includes queue (line) & server  arrival rate () UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 7
  • 8. Queuing Networks Model of tasks or services  Node includes queue (line) & server  waiting time UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 8
  • 9. Queuing Networks Model of tasks or services  Node includes queue (line) & server  service time UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 9
  • 10. Queuing Networks Model of tasks or services  Node includes queue (line) & server  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 10
  • 11. Stable Systems Stable queuing system:  arrival rate = departure rate UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 11
  • 12. Stable Systems Stable queuing system:  arrival rate = departure rate UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 12
  • 13. Stable Systems Stable queuing system:  arrival rate = departure rate UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 13
  • 14. Stable Systems Stable queuing system:  arrival rate = departure rate What happens if  > departure rate?  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 14
  • 15. Stable Systems Stable queuing system:  arrival rate = departure rate What happens if  > departure rate?  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 15
  • 16. Stable Systems Stable queuing system:  arrival rate = departure rate What happens if  > departure rate?  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 16
  • 17. Stable Systems Stable queuing system:  arrival rate = departure rate What happens if  > departure rate?  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 17
  • 18. Networks of Queues Can build system from connected servers  Latency = time for one thing to get through  Throughput = service rate  5/sec 5/sec 5/sec Throughput?  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 18
  • 19. Networks of Queues Can build system with numerous  connected servers Latency = time for one thing to get through  Throughput = service rate  5/sec 1/sec 5/sec Throughput?  Lowest throughput = bottleneck  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 19
  • 20. Little’s Law Little’s Law – applies to any “blackbox”  server Queue length (N) =  arrival rate () * average waiting time (T) N=T  N  T UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 20
  • 21. Applications of Little’s Law Compute waiting time to get into  restaurant, bar, etc. If N = 20 people in front of you,   = departure rate = 1 / 5 min., how long will you wait in line? N=T N  T UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 21
  • 22. Applications of Little’s Law Required service time?  Arrival rate = one job @ 500 ms  Average queue length = 10  T=?  What’s the average latency?  N=T N  T UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 22
  • 23. Applications of Little’s Law Required service time?  Arrival rate = one job @ 500 ms  Average queue length = 5  T=?  What’s the average latency?  N=T N  T UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 23
  • 24. Motivating Example: Image Server image server Client  Requests image @ desired  quality, size not found Server  Images: RAW  http://server/Easter-bunny/ 200x100/75 Compresses to JPG  Caches requests  Sends to client  client UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 25. Problem: Concurrency image Could write sequential code server  but… More clients (latency)  Bigger server  Multicores, multiprocessors  One approach: threads  Limit reuse,  risk deadlock, burden programmer Complicate debugging  Mixes program logic &  concurrency control clients UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 26. The Flux Programming Language High-performance & deadlock-free concurrent programming w/ sequential components Flux = Components + Flow + Atomicity  Components unmodified C, C++ (or Java)  Flow implicitly || path thru components  Atomicity high-level mutual exclusion  Compiler generates:  Deadlock-free, runtime-independent server  Threads, thread pools, events, …  Path profiling  Discrete event simulator  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 27. Flux Outline Intro to Flux: building a server  Components  Flows  Atomicity  Performance results  Server performance  Performance prediction (QNMs)  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 28. Flux Server “Main” Source nodes originate flows  Conceptually in separate thread  Executes inside implicit infinite loop  Here: initiates flow for each image request  source Listen  Image; Listen image server ReadRequest Compress Write Complete ReadRequest Compress Write Complete ReadRequest Compress Write Complete UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 29. Flux Image Server Basic image server requires:  HTTP parsing (http)   Socket handling (socket)  JPEG compression (libjpeg)  All UNIX-style C libraries Abstract node = flow across nodes  Concrete or abstract  Image = ReadRequest  Compress  Write  Complete; image server ReadRequest Compress Write Complete http libjpeg socket http UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 30. Control Flow Direct flow via user-supplied predicate types  Type test applied to output  Note: no variables – dispatch on output “type”  Here: cache frequently requested images  typedef hit TestInCache; Handler:[_,_,hit] = ; Handler:[_,_,_] = ReadFromDisk  Compress  StoreInCache; hit handler ReadRequest CheckCache Write Complete Listen handler StoreInCache ReadInFromDisk Compress UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 31. Supporting Concurrency Many clients = concurrent flows  Must keep cache consistent  Atomicity constraints  Same name = mutual exclusion  Apply to nodes or whole flow (abstract node)  atomic CheckCache {}; {, }; atomic Complete atomic StoreInCache {}; CheckCache hit ReadRequest Write Complete CheckCache hit hit ReadRequest Write Complete CheckCache hit Writehandler ReadRequest Complete Listen ReadInFromDisk Compress StoreInCache ReadRequest CheckCache StoreInCache Write Complete ReadInFromDisk Compress ReadInFromDisk Compress StoreInCache handler StoreInCache ReadInFromDisk Compress UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 32. More Atomicity Reader / writer constraints  Multiple readers or single writer (default)  atomic ReadList: {listAccess?}; atomic AddToList: {listAccess!}; Per-session constraints  User-supplied function ≈ hash on source  Added to flow ≈ chooses from array of locks  atomic AddHasChunk: {chunks(session)}; UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 33. Preventing Deadlock Naïve execution can deadlock  atomic A: {z,y}; atomic A: {y,z}; atomic B: {y,z}; atomic B: {y,z}; Establish canonical lock order  Partial order  Alphabetic by name  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 33
  • 34. Preventing Deadlock, II Harder with abstract nodes  A = B; C = D; A:{z} A A{z} atomic A{z}; C{y} C B atomic B{y}; atomic C{y,z}; Solution: Elevate constraints; fixed point  A = B; C = D; A{y,z} C atomic A{y,z}; B atomic B{y}; atomic C{y,z}; UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 34
  • 35. Handling Errors What if image requested doesn’t exist?  Error = negative return value from component  Remember – nodes oblivious to Flux  Solution: error handlers  Go to alternate paths on error  Possible extension – can match on error paths  handle error ReadInFromDisk  FourOhFour; hit handler ReadRequest CheckCache Write Complete Listen handler StoreInCache ReadInFromDisk Compress FourOhFour UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 36. Almost Complete Flux Image Server source Listen  Image; Image = ReadRequest  CheckCache  Handler  Write  Complete; Handler[_,_,hit] = ; Handler[_,_,_] = ReadFromDisk  Compress  StoreInCache; atomic CheckCache: {cacheLock}; atomic StoreInCache: {cacheLock}; atomic Complete: {cacheLock}; handle error ReadInFromDisk  FourOhFour; Concise, readable expression of server logic  No threads, etc.: simplifies programming, debugging  image hit handler server ReadRequest CheckCache Write Complete Listen handler StoreInCache ReadInFromDisk Compress UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 37. Flux Outline Intro to Flux: building a server  Components, flow  Atomicity, deadlock avoidance  Performance results  Server performance  Performance prediction  Future work  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 38. Flux Results Four servers:  Image server (+ libjpeg) [23 lines of Flux]  Multi-player online game [54]  BitTorrent (2 undergrads: 1 week!) [84]  Web server (+ PHP) [36]  Evaluation  Benchmark: variant of SPECweb99  Three different runtimes here  Thread: one per connection  Thread pool: fixed max # threads  Event-driven: helper threads for blocking calls  Compared to Capriccio [SOSP03], SEDA [SOSP01]  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 38
  • 39. Web Server UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 39
  • 40. Performance Prediction observed parameters UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 40
  • 41. Performance Prediction observed parameters UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 41
  • 42. The End UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 42