Server Scheduling in the Lp norm Nikhil Bansal
Server Scheduling in the Lp norm Nikhil Bansal (CMU) Kirk Pruhs (Univ. of Pittsburgh) 1
Scheduling Provide service such that users are satisfied 2
Motivation Single Machine Arbitrary arrival or release time ( rj) Arbitrary processing requirement or size ( pj) t=0 (r 1) r 2 r 3 3
Motivation Single Machine Arbitrary arrival or release time ( rj) Arbitrary processing requirement or size ( pj) t=0 (r 1) r 2 r 3 c 2 c 3 c 1 Job 1 preempted 4
Flow Time Completion time: cj Flow time: fj = cj-rj (time user waits) t=0 (r 1) r 2 r 3 c 2 c 3 c 1 Flow Time of Job 1 5
Flow Time Completion time: cj Flow time: fj = cj-rj (time user waits) t=0 (r 1) r 2 r 3 c 2 c 3 c 1 Flow Time of Job 3 6
Stretch (i) = Flow time (i) / Size (i) [Bender Chakrabarti Muthukrishnan’ 98] Jobs willing to tolerate flow time proportional to size Also known as normalized flow time Each job contributes equally 7
Known Results Minimize total flow time ( i fi) [L 1 norm] Optimal Online algorithm: Work on job with smallest remaining proc. time (SRPT) SRPT is 2 – competitive for total stretch [Gehrke, Muthukrishnan, Rajaraman, Shaheen’ 99] Concern: Big jobs could be stuck! Starvation! Another end: Minimize maximum flow time [L 1 norm] First Come First Served (FCFS) is optimal But bad average performance [Smalls stuck behind big] 8
Balancing average and maximum Lp norms: Penalize outliers, good average performance Online algorithms for minimizing 1) Flow time (i. e. ( j fjp)1/p) 2) Stretch (i. e. ( j sjp)1/p) Lp norms, previously studied: Load balancing [Awerbuch Azar Grove+ ’ 95, Alon Azar Woeginger Yadid ’ 97, Avidor Azar Sgall ’ 01] Completion time scheduling [Epstein, Sgall’ 99] 9
Lower Bound SRPT, FCFS optimal algorithms for p=1, 1 No no(1) competitive randomized alg for Lp norms of flow time and stretch, for 1<p<1 Size L Suppose p=2 L 3 jobs of size 1 By time L 3 , If do not finish size L job, bad! Online: Cost of big (L 3)2 = L 6 Opt: L 3 Smalls delayed by L= O(L 5) 10
Lower Bound SRPT, FCFS optimal algorithms for p=1, 1 No no(1) competitive randomized alg for Lp norms of flow time and stretch, for 1<p<1 Optional Stream of jobs Size L L 3 jobs of size 1 L 5 jobs of size 1/L 2 By time L 3 , If do not finish size L job, bad! 11
Results Resource Augmentation: [Kalyanasundaram, Pruhs 95] Online has more resources s-speed, c-competitive max. I Online(I, s) / Opt(I, 1) · c Thm: SRPT, SJF (Shortest Job First) are 1+ speed O(1/ ) competitive No starvation unless close to peak capacity 12
Performance Interpreting Resource Augmentation Optimal Load 13
Performance Interpreting Resource Augmentation Online Optimal Load 14
Proof Sketch Lp norm of flow time as ‘weighted’ Flow Time problem Age(j, t) = 0 t-rj if t<rj or t>cj if rj < t < cj Observation: fj 2/2 = t age(j, t) j fj 2 /2= t j: alive at time t age(j, t) Proof idea: Show, at all times total age of alive jobs < O(1/ )¢ total age under Opt 15
Proof Idea If job J of size x delayed for t units under SJF Then either, 1) 2) Had lot of work of size < x before arrival of J Lot of work arriving continuously since J arrived. In either case, Opt can be shown to have sufficiently many “old’’ unfinished jobs, 16
Non-Clairvoyant Scheduling Non-Clairvoyant Model [Motwani Phillips Torng ’ 94] Scheduler does not know size of a job Learns size only when job finishes. Cannot do things like Shortest Job First, SRPT What can we do? FCFS, Round Robin (time-sharing), … 17
Measuring Performance Resource Augmentation: s-speed, c-competitive Max I Online non-clairvoyant (s, I) Opt offline clairvoyant (1, I) ·c 18
The Algorithm (MLF) Multi-Level Feedback (MLF): Used in Windows NT, Unix Levels L 0, L 1, L 2, … job enters L 0 first In Li, receive 2 i amount of work, then promoted to Li+1 L 2 L 1 L 0 Work on level i, iff no job in level 0. . i-1 19
Previous Results (Non-Clairvoyant) L 1 norm of Flow Time: MLF: 1+ speed, O(1/ ) competitive [Kalyanasundaram, Pruhs ’ 95] L 1 norm of Stretch: MLF: 1+ speed, O(1/ 4 log 2 B) competitive [B. , Dhamdhere, Konemann, Sinha’ 03] Any algorithm is 1+ speed (log B/ ) competitive B = ratio of maximum to minimum job size 20
Our Results MLF is 1+ speed , O(1/ 4) competitive for all norms of flow time MLF is 1+ speed, O(1/ 4 log 2 B) competitive for all norms of stretch 21
Analysis Generic technique: reduce MLF to SJF (Shortest Job First) Reduces a non-clairvoyant problem into a clairvoyant one. 22
Final Result Round Robin: At any time, share processor equally Considered to be fair (each job treated equally) But not good according to the Lp norm criteria Round Robin is not 1+ speed no(1) competitive (for sufficiently small ) 23
Open Problems 1) Offline case totally open NP-Hard? Non-trivial approximation algorithms? 2) Multiple machines 3) Other notions to deal with tradeoff between average vs. max performance 24
Thank You! 25
An example Size L ……… Goal: Minimize fi 2 (i. e. p=2) a job of size 1 arrives for n time units If n small ( < L 2), work on the small jobs If n big ( > L 2), at time L 2, shift to finish the big job Good algorithm: A combination of SRPT + FCFS 26
MLF 15 7 3 1 27
MLF 15 7 3 1 28
MLF 15 7 3 1 29
MLF 15 7 7 3 3 1 1 30
MLF 15 7 7 3 3 1 1 31
MLF 15 7 7 3 3 1 1 32
MLF 15 7 7 3 3 1 1 33
MLF 15 7 7 3 3 1 1 34
Connection between MLF and SJF 15 Instance J : 2 i-1 Instance J’ : 1, 2, 4, …, 2 i-1 7 J J’ 3 1 1 2 4 8 35
MLF and SJF 15 Instance J : 2 i-1 Instance J’ : 1, 2, 4, …, 2 i-1 7 3 1 1 2 4 8 36
MLF and SJF 15 Instance J : 2 i-1 Instance J’ : 1, 2, 4, …, 2 i-1 7 3 1 1 2 4 8 37
MLF and SJF Instance J : 2 i-1 Instance J’ : 1, 2, 4, …, 2 i-1 15 7 7 3 3 1 1 1 2 4 8 1 2 4 38
MLF and SJF MLF works on smallest level SJF works on smallest job 15 MLF works on a job in level i SJF works on 2 i size copy of same job 7 7 3 3 1 1 1 2 4 8 1 2 4 39
MLF and SJF MLF works on smallest level SJF works on smallest job 15 MLF works on a job in level i SJF works on 2 i size copy of same job 7 7 3 3 1 1 1 2 4 8 1 2 4 40
Analysis Idea 2 Main ideas: 1) MLF(J) can be viewed as SJF (J’) 2) We know that SJF(J’) ¼ Opt(J’), so MLF(J) ¼ Opt(J’) previous clairvoyant result Opt(J) Fairly general technique, usually allows us to reduce a non-clairvoyant problem into a clairvoyant one. 41
- Slides: 41