Docstoc

Supermarket Job Application

Document Sample
Supermarket Job Application Powered By Docstoc
					            Job Fairness in Queue Scheduling:

                         Hanoch Levy
                  School of Computer Science
                      Tel Aviv University




                           May 2005


8/18/2011                       Fairness of Job Scheduling in Queueing Systems, H. Levy   1
                 Why (ordered) Queues?
                 Why Fairness inQueues?

                             “Not
                            Fair!!!”

                    “This is
                  more Fair…”




            To provide FAIRNESS in waiting/service

       Queue = “A Fairness Management Facility”

8/18/2011                              Fairness of Job Scheduling in Queueing Systems, H. Levy   2
                 Why Fairness in Queues? (2)
            • Fairness inherent/crucial part of queues
            • Recent studies, Rafaeli et. al. [2003]
              (experimental psychology):
               – Experiments on humans in queue scenarios
               – Fairness in queue is very important to people
               – Perhaps even more than delay itself!


                                   The issue
            • Evaluate (metrics) Queue Fairness
            • Use on: System + scheduling policies
            • Aim: Applications
8/18/2011                                   Fairness of Job Scheduling in Queueing Systems, H. Levy   3
                 The Size vs. Seniority
                       Dilemma
            • Mr. Short vs. Mrs. Long




                     Mr. Short          Mrs. Long

            • Is it more fair to serve Short ahead of
              Long? By how much?

8/18/2011                         Fairness of Job Scheduling in Queueing Systems, H. Levy   4
                                        Outline
            • Queue Model
            • Job-Based systems, Flow-Based systems + applications
            • Prior work
            • “Requirements”
            • The performance issue: Delay vs. Service
            • The granularity level: How fine…
            • Dealing with stochastics
            • The physical entities: seniority, service requirement,
              resources
            • The Fairness Measures - Overview + properties:
                –   Seniority based fairness
                –   Service time based fairness
                –   Resource allocation based fairness
                –   Mixture based
            • Application perspective
            • References
8/18/2011                                       Fairness of Job Scheduling in Queueing Systems, H. Levy   5
            Queue Model (single server)
                  Jobs                                Queue
                                                                                            Server

                Ji
                si
              Service time

                     Departures
                                                di

              Arrivals       ai
8/18/2011                         Fairness of Job Scheduling in Queueing Systems, H. Levy            6
                          History:
                Queueing Theory and Fairness
            • Queueing theory: Decades of research
               – Delay of individual
               – Practical Applications: many & diverse
            • Fairness in queues:
               – Many importance statements:
                  • Importance of fairness: Larson (1988), Palm (1953), Mann (1969),
                    Whitt (1984), Rothkopf & Rech (1987)
               – Analysis: was Little, now growing(job fairness):
                                                                                                    Exception:
                  • Morris & Wang (85)
                  • Gordon (87)
                                                                               Flow                     Fairness
                  • Avi-Itzhak & Levy (96)
                  • Bender, Chakrabarti . Muthukrishnan (98), Wierman & Harchol-
                    Balter (03), Harchol-Balter et. al. (03)
                  • Avi-Itzhak, Levy & Raz (05), Raz, Avi-Itzhak & Levy (04, 05a,b),
                    Raz, Levy& Avi-Itzhak (04), Brosh, Levy & Avi-Itzhak (05)
                  • Sandmann (05) (more is coming)


8/18/2011                                        Fairness of Job Scheduling in Queueing Systems, H. Levy           7
                        History:
             Queueing Theory and Fairness (2)
            •  We know only little about queue
              (job) fairness!
            •  More complex than measuring
              individual delay!




8/18/2011                        Fairness of Job Scheduling in Queueing Systems, H. Levy   8
                     Designing a Metrics -
                         Keep in mind:
            • To be used by:
               – Researchers
               – Designers / operators
               – Customers (appeal to)

            • Desired properties (“requirements”)
               – Fits application(s) [as many as
                 possible]
               – Based on a “sound” intuitive basis                                                 Call
                                                                                                   center
               – Fit widely accepted intuition in
                 simple cases
               – Yields to analysis

8/18/2011                                Fairness of Job Scheduling in Queueing Systems, H. Levy            9
                     The performance issues:
                        Delay vs. Service
            • Delay:                                          What
               – Job delay (waiting time, sojourn               a
                 time)                                        wait…
               – Traditional queueing-theory
                 measure
            • The major factor when service
              is guaranteed

            • Job (service) Completion
               – Have the job done                              My
                                                               seat
               – Less popular in queueing theory                is
               – Applies when service is not                  gone…
                 guaranteed
                  • Ticket line for scarce tickets


8/18/2011                                   Fairness of Job Scheduling in Queueing Systems, H. Levy   10
             Granularity of Fairness Evaluation
       • At what granularity level, should fairness
         be evaluated
             • Individual
             • Scenario                           C2                 C1                       C0

             • System (steady state)
            • All are important
              • Individual, scenario: build confidence (scale
                of reference) in metrics
              • System : to evaluate systems/policies
            • Note: All exist for individual waiting times
8/18/2011                           Fairness of Job Scheduling in Queueing Systems, H. Levy        11
            The Physical Factors (queues)




              Seniority              Size                                   Resources
            (Arrival Time)   (Service Requirement)




8/18/2011                              Fairness of Job Scheduling in Queueing Systems, H. Levy   12
               Size and Seniority preference
                 principles (“requirements”)

            • Seniority




            • Size




8/18/2011                    Fairness of Job Scheduling in Queueing Systems, H. Levy   13
               Size and Seniority preference
                 principles (“requirements”)
            • Seniority principle
              – Weak: All jobs same service times
                 if ai< aj then more fair to
                complete service of Ji before Jj
                 • Strong: Ji and Jj same service times


            • Service-requirement principle
               – Weak: All jobs same arrival times
                  if si< sj then more fair to
                 complete service of Ji before Jj
                  • Strong: Ji and Jj same arrival times


8/18/2011                                 Fairness of Job Scheduling in Queueing Systems, H. Levy   14
            How Scheduling policies meet the
             principles (are fair by principle)
                     FCFS   LCFS   ROS         Shortest           longest
                                                                  job
                                   (random)    job first          first



       Seniority      +      -        -              -                   -


       Service
                      -      -        -              +                   -
       requirement




8/18/2011                                 Fairness of Job Scheduling in Queueing Systems, H. Levy   15
                 The Size vs. Seniority
                       Dilemma
            • Mr. Short vs. Mrs. Long




                     Mr. Short          Mrs. Long

            • Is it more fair to serve Short ahead of
              Long? By how much?

8/18/2011                         Fairness of Job Scheduling in Queueing Systems, H. Levy   16
                Review of Measures (job based)

       • Seniority based
                                                               Seniority
                                                             (Arrival Time)




      • Service-requirement based                                                 Size
                                                                   (Service Requirement)




       • Resource based
            •   Mixtures                                      Resources
8/18/2011                      Fairness of Job Scheduling in Queueing Systems, H. Levy     17
              Approach 1: Order (seniority)
                        Fairness
       • Gordon (87) – Ph.D MIT                                                                 Seniority
                                                                                              (Arrival Time)
       • Deals with skips and slips:
            – Performance measure of overtaking to
              quantify the level of “social justice”
       • B skips A (A experiences a slip): A
         arrives before B, B leaves before A                                                       B


       •    Considers several Markovian models                                                          A

       •    Analyses distribution of #slips, #skips
       •    Measure: No explicit suggestion
       •    Lets try: E[#skips ] - E [ # slips]
       •    Problem: E[#skips ] - E [ # slips]=0
       •    So perhaps: E[#skips ]
8/18/2011                                Fairness of Job Scheduling in Queueing Systems, H. Levy            18
                Approach 1: Order (seniority)
                      Fairness: results
       • Systems analyzed :                                                                      Seniority
            –   2 M/M/1 in parallel                                                            (Arrival Time)
            –   2 M/M/1’s with one SJQ “smart” customer
            –   Multi server system: M/M/m
            –   Infinite server system: M/G/Inf
       • Analysis: distribution of SKIP and SLIP                                                    B

       • Results:
            – AVG(#skips) = AVG (#slips)                                                                 A
            – Most systems: Dist(#skips) != Dist (#slips)
            – Smart customer: increases # skips,
              decreases # slips
            – M/U/Inf with symmetric service time dist:
              Dist(#skips) = Dist (#slips) [only system
              found]

8/18/2011                                 Fairness of Job Scheduling in Queueing Systems, H. Levy            19
             Approach 1: Order (seniority)
              Fairness: How do I use it?
       • Compute: Dist(#skips), Dist                                                          Seniority
                                                                                            (Arrival Time)
         (#slips)
            – Analysis or simulation
       • How to use for fairness measure –                                                       B
         open issue.
                                                                                                      A




8/18/2011                              Fairness of Job Scheduling in Queueing Systems, H. Levy            20
              Measure 2: “service-time”
                      Fairness
      • Bender, Chakrabarti . Muthukrishnan (1998),
        Harchol-Balter et. al. (2003)                                                                 Size
                                                                                      (Service Requirement)
      • Wierman & Harchol-Balter (2003):
            – Propose a Fairness Criterion
            – Emphasis on service requirement
                                                                                              How my
            – Slowdown: for job of size x                                                      type is
              compute E[T(x)/x]                                                               doing on
            – If the slowdown is lower then 1/(1-                                             average
              ρ) for all x - FAIR
            – Classification of a large variety of
              policies:
               • Always fair: fair for all dist. + loads
               • Always unfair: unfair for all dist. + loads


8/18/2011                                   Fairness of Job Scheduling in Queueing Systems, H. Levy          21
            •Compute E[T(x)] (use queueing theory
                                                                                                 Size
            or simulation), divide by x and check                                            (Service Req.)
            rules
            • You end up with a criterion.
            • Can create a measure.




8/18/2011                          Fairness of Job Scheduling in Queueing Systems, H. Levy               22
              Measure 3: Resource Allocation
                  Fairness (RAQFM)
      • Raz, Levy, Avi-Itzhak (04)
      • Aim at the dilemma between size and seniority                                                 Resources

      • Focus on: fair share of resources
      • Ideal: At t, each customer deserves 1/N(t) of
        system resources (N(t)= # customers(t))
      • Compare warranted service with granted service
                                                                               di

            • Warranted service (customer i)
                                                                                     1
                                                               Ri             
                                                                               ai
                                                                                    N (t )
                                                                                           dt
                                                                          di

            • Granted service:                                Gi          s (t )dt  s
                                                                                i                     i
                                                                          ai


            • Individual Discrimination:                         Di  Ri  Gi

            • System unfairness measure: Summary statistics (var) of                                      Di
8/18/2011                                   Fairness of Job Scheduling in Queueing Systems, H. Levy               23
            Resource allocation Fairness:
                      Results
      • Adhering to principles:                  Resources

        – STRONG Seniority service principles – YES

            – WEAK Service-time service principle – YES
            – STRONG Service-time service principle – NOT




8/18/2011                          Fairness of Job Scheduling in Queueing Systems, H. Levy   33
            Resource allocation Fairness:
                    Results (2)
      • PS most fair                                                                                                          Resources
      • Reacts to both s.time and seniority
            – FCFS > LCFS (seniority dominant)
            – FCFS < PLCFS (s. time dominant)
                        7

                                   Preemptive LCFS
                        6          Non-Preemprive LCFS
                                   ROS
                                   FCFS
                        5          PS


                        4
               Var[D]




                        3


                        2


                        1


                        0
                         0   0.1     0.2    0.3   0.4        0.5   0.6     0.7      0.8      0.9
                                                         

8/18/2011                                                           Fairness of Job Scheduling in Queueing Systems, H. Levy          34
            Resource allocation Fairness:
                    Results (3)
      • Multiple server more fair than single                                            Resources
        server with same combined rate
      • Single Queue more fair than Multi-Queue
      • Jockeying increases fairness
      • Jockeying from head more fair than
        jockeying from tail
      • Prioritizing short jobs is more fair in most
        cases, but not if the jobs are almost as
        large as the rest of the population


8/18/2011                      Fairness of Job Scheduling in Queueing Systems, H. Levy          35
              Resource Allocation Fairness:
                     Applicability
            • Good   for:                                 What                                     Resources
               – S. times and A. times                      a
                                                          wait…
               arbitrary
            • Issue is: Waiting times

            • Applications:
               - Waiting lines where resources
               guaranteed
               - Call centers (non-scarce resources)
               - Web services
               - Supermarkets
               - Airport services

8/18/2011                                Fairness of Job Scheduling in Queueing Systems, H. Levy          36
            Resource Allocation Fairness:
                  How Do I use it
            • Derive variance of discrimination at                                             Resources
            steady state
            •Use Queueing Theory + methodology
            developed
               -Good for variety of Markovian systems
               -Large systems need approximations
               (more research) Waiting lines where
               resources guaranteed
            -Use simulation




8/18/2011                            Fairness of Job Scheduling in Queueing Systems, H. Levy          37
            What fits? Go by the application

              Service         Airline                  Order
                              reservation, Call
              critical        center, “Line for        fairness
                              bread”
                                                                         Seniority
                                                                       (Arrival Time)
              Delay sensitive, Computer                “service
              seniority-blind systems (?)              time”
              (and careless)
                                                       fairness                             Size
              customers                                                       (Service Requirement)

              Delay sensitive, Call centers,           Resource
              variable service Supermarkets,           allocation
              time             Banks,                                                              Mixture
                               Computer
                                                       fairness
                                                                                         Resources
                              systems
8/18/2011                                Fairness of Job Scheduling in Queueing Systems, H. Levy         38
       How People Perceive Queue Fairness
      1. Rafaeli et. al. (2005): Queue experiments on
         humans
      2. FCFS is FAIR (seniority)
      3. Violation of FCFS == unfair
         • Regardless if close to the person asked or
            away of it.
         • Size-issue – not addressed yet.
      4. Multi-server:
         • Multi-Queue (MQ) less fair than single queue.
         • One queue in MQ is shorter  less fair.
         • If people PAY for the short Q (first-class) 
            Fair.

8/18/2011                        Fairness of Job Scheduling in Queueing Systems, H. Levy   39
                       Concluding remarks
      1. Fairness in Queues is important
      2. Measures must
         1. Fit applications
         2. Agree with one’s intuition / be consistent
            - Researcher, designer, customer
         3. Yield to analysis
      3. Research of subject in it’s early stages
      4. Much more to study:
            –   Scheduling policies
            –   Weights
            –   Multiple queues /servers
            –   Complex structures
            –   Relations between measures
            –   Other measures…
8/18/2011                               Fairness of Job Scheduling in Queueing Systems, H. Levy   40
            Closing Words: Why Study Fairness
                   in Queues (5 reasons)
       1. The Fundamental:               (“Q = fairness”)
              –   Isn’t fairness why we have queues (for human services) in
                  the first place?
       2. The Scientific evidence: (Rafaeli et. al. [2003])
              –   Fairness in queues important to people / perhaps > delay
       3. The Inductive reasoning:
              –   WFQ: 10’s of papers – fairness on O(1) microsecond jobs!!
       4. The Challenge:
          – We know very little on Queue fairness
          – The problem is harder than Q delay!

            5. The Practical: Relax your nerves…

8/18/2011                                      Fairness of Job Scheduling in Queueing Systems, H. Levy   41
            THANK YOU




8/18/2011       Fairness of Job Scheduling in Queueing Systems, H. Levy   42
                     Dealing with Stochastics:
               Actual measures vs. Expected values (2)

            • Actual measure:           • Expected values:
            • Harder to compute         • May be misleading
                                                • “Like having salaries
                                                  given in random (with
                                                  their mean be the real
                                                  salary)”.

             How do                         How do they
            they treat                       treat short
             me now…                        jobs on avg…




8/18/2011                          Fairness of Job Scheduling in Queueing Systems, H. Levy   45
                     Dealing with Stochastics:
                         The Black Box question
             • Customer does not see other customers
            • “Open approach”:          • “Close approach”:
               Customer is still          don’t see (arrivals)
               interested in Fairness     don’t care.
               even though he cannot    • Only size matters: Is my
               check it directly          size class doing ok?

             How do                              How do they
            they treat                            treat short
             me now…                             jobs on avg…




8/18/2011                               Fairness of Job Scheduling in Queueing Systems, H. Levy   46
                    Measure 4: Mixture
                                                                                                       Mixture

            • Sandmann (05)
            • Mixture: seniority and size
            • Accounts for 2 parameters:
              – #Overtaking (=#slips) [seniority]
              – #Large jobs           [Size]
                 • X is a large job for C if:
                     – i) Upon C’s arrival X has no-less residual service than C.
                     – ii) X departs before C.

            • Fairness measure:                   1 /  # overtakingi  # l arg ei
                                                         i




8/18/2011                                    Fairness of Job Scheduling in Queueing Systems, H. Levy             47
             Measure 4 - Mixture : results
                                                                                                 Mixture
            • Adhering to principles:
               – STRONG Seniority service principles – YES
               – STRONG Service-time service principle – YES
            • Difficulties: Asymmetry in sensitivity to size +
              seniority
               – E.g.: X arrives with 100 sec s.time, and waits an
                 hour. Y arrives 1 hour later with 99 sec s.time.
                 It is as fair to serve in both orders.
               – Same if 10 hours.


8/18/2011                              Fairness of Job Scheduling in Queueing Systems, H. Levy             48
            Measure 4 - Mixture : How do I
                        use it
            • Analysis of skips – see Gordon (87) – Markovian –Mixture

              can do.
            • Analysis of Large – not provided yet (perhaps in
              the making).




8/18/2011                              Fairness of Job Scheduling in Queueing Systems, H. Levy   49
                       Job-Based vs. Flow-Based
                        +Applications (repeat)

             Jobs                 Q   Server             Jobs                             Q              Server
             Ji                                          Ji


            • JOB BASED                               • FLOW BASED
            • Customer = Job                          • Customer = Flow

            • Applications:                           • Applications:

                  – Networking: Application                    – Networking:network level
                  level equipment: Web                         equipment:
                  server, file server                                  – Routers, gateways,
                  –Supermarket, Bank, public                           load-balancers
                  office + alike
                  – Call center
                  – Computer system
8/18/2011                                      Fairness of Job Scheduling in Queueing Systems, H. Levy            50
                 A word on flow-based
                      measures
       • Deal with flows (of packets)
       • Interested mainly in throughput
       • Literature:
            – Fair bandwidth allocation (network)
               • MinMax fairness (Jaffe (81))
               • Proportional Fairness (Kelly (97))
            – Fair Scheduling
               • Weighted Fair Queueing (WFQ)
                  – Demers, Keshav and Shenker (1990), Greenberg and Madras (1992),
                    Parekh (1992), Parekh and Gallager (1993), (1994), Golestani
                    (1994), Rexford, Greenberg and Bonomi (1996), Bennet and Zhang
                    (1996), others.


8/18/2011                                   Fairness of Job Scheduling in Queueing Systems, H. Levy   51
               Measure 5: PS proximity
                WFQ/RFB literature
       • Scheduling fairness measures
       • Worst Case deviation from PS (extreme values)
       • Relative Fairness Bound (Golestani (94))
       • RFB:           max i , j ,t | U i (t1 , t2 )  U j (t1 , t2 ) |


      • Can we apply it to jobs (problematic):
         – Not “continuously active”
            – Try on L, S: assume FCFS (L arrives  before): RFB=L
            – Try on L, S: assume LCFS (L arrives after): RFB=L
            – General M/G/1 (FCFS, LCFS): infinity!


8/18/2011                                                Fairness of Job Scheduling in Queueing Systems, H. Levy   52
              Measure 5: PS proximity
               WFQ/RFB literature
      • Absolute Fairness Bound (AFB) (Greenberg and Madras
        (1992) and Keshav (1997))

      • Maximum (time) discrepancy between schedule and PS
      • Applying to jobs:
         • Try PS completion discrepancy of job
               – LCFS = FCFS = infinity!
               – Most non-PS based (non-WFQ): infinity! (SJF, LJF,
                 SRPT..)
            • Good for very precise PS imitations



8/18/2011                                Fairness of Job Scheduling in Queueing Systems, H. Levy   53
              Measure 1: Order (seniority)
                       Fairness
      • Avi-Itzhak & Levy (96, 04)                                                               Seniority
                                                                                               (Arrival Time)
      • Axioms (for G/D/1): what happens to
        unfairness measure when interchanging
        customers:
         – P1: Monotonicity in seniority difference
              of interchanged neighbors
            – P2: Reversibility of neighbor interchange
            – P3: Independence on position and time
            – P4: Fairness change is not affected by
              customers not interchanged
            – P4G: interchange of non-neighbors



8/18/2011                                 Fairness of Job Scheduling in Queueing Systems, H. Levy          54
                  Order Fairness: results
                                                                                                   Seniority
            ai - Arrival time of customer i                                                      (Arrival Time)
            Di - Waiting displacement of customer i
            C > 0, arbitrary constant

            • Expected fairness per customer
                                                    m
                        F  c lim m 1 / m ai Di
                                                   i 1
            • Claim: Under FCFS:            F* 0
             • FCFS most fair (LCFS least)
            • Thm : Let (W, W*) be the steady state waiting
              time under (policy, FIFO), then:
                          c
                      F  [Var (W *)  Var (W )]
                          2
8/18/2011                                   Fairness of Job Scheduling in Queueing Systems, H. Levy          55
             Order Fairness: results (2)
                                                                                        Seniority
            • Adhering to principles:                                                 (Arrival Time)


              • Strong seniority service principle:
                YES
              • Service-time service principle:
                NOT




8/18/2011                        Fairness of Job Scheduling in Queueing Systems, H. Levy          56
              Order Fairness: Properties &
                     Applicability
                                                                                                  Seniority
            • Good   for:                                                                       (Arrival Time)
               – S. times identical
               – S. times don’t matter                   My
            • Issue is: Job completion                  seat
                                                         is
            • Applications:                            gone...
               - Scarce-ticket lines
               - Some call-centers

            • FCFS is most fair (LCFS least)

            • Intuition & concepts:
               - Peoples’ strong belief in order fairness

8/18/2011                                  Fairness of Job Scheduling in Queueing Systems, H. Levy          57
              Measure 1: Order (seniority)
               Fairness: How do I use it?
                                                                                           Seniority
                                                   m                                     (Arrival Time)
     • Compute         F  c lim m 1 / m ai Di
                                                  i 1
            – Simulation
      • Compute Var[W] for steady
        state




      • Remark: range of variance


8/18/2011                           Fairness of Job Scheduling in Queueing Systems, H. Levy          58
                 “Service-time” Fairness:
                         Results
      • Classification (not measure) of a large                                                           Size
                                                                                                      (Service Req.)
        variety of policies
      • Any preemptive size based policy is always
        unfair (all loads & all service dists).
      • All non-size based non-preemptive policies are always
        unfair for service time dist defined on neighborhood
            of zero (short jobs discriminated).
      • Age based policies are always unfair

      • FCFS is always UNFAIR
      • LCFS (preemptive) +PS are always FAIR

8/18/2011                                   Fairness of Job Scheduling in Queueing Systems, H. Levy               59
            “Service-time” Fairness:
                   Results (2)
      • Adhering to principles:                                                           Size
                                                                                      (Service Req.)

        – Seniority service principles –
          NOT
        – Service-time service principle –
          Open question




8/18/2011                   Fairness of Job Scheduling in Queueing Systems, H. Levy               60
             S. time Fairness: Properties &
                      Applicability
            • Good   for:
                                                                                                    Size
               – A. times identical                                                             (Service Req.)
               – A. times not known / don’t see the queue
               – Your size is always the same
            • Issue is: “wash” seniority by averaging.
            • Advantage: relatively simple analysis

            • Applications: Computer systems (?)




8/18/2011                             Fairness of Job Scheduling in Queueing Systems, H. Levy               61
            S. time Fairness: How do I use it
            •Compute E[T(x)] (use queueing theory
                                                                                                 Size
            or simulation), divide by x and check                                            (Service Req.)
            rules
            • You end up with a criterion.
            • Can create a measure.




8/18/2011                          Fairness of Job Scheduling in Queueing Systems, H. Levy               62
8/18/2011   Fairness of Job Scheduling in Queueing Systems, H. Levy   63

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:36
posted:8/18/2011
language:English
pages:52
Description: Supermarket Job Application document sample