anticipatory disk scheduling.ppt

26
Anticipatory Disk Scheduling Sitaram Iyer Peter Druschel Rice University

Upload: others

Post on 01-Dec-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Anticipatory Disk Scheduling.ppt

Anticipatory Disk Scheduling

Sitaram Iyer Peter Druschel

Rice University

Page 2: Anticipatory Disk Scheduling.ppt

Disk schedulers

Reorder available disk requests for

• performance by seek optimization,• performance by seek optimization,

• proportional resource allocation, etc.

Any policy needs multiple outstanding requests to make good decisions!

Page 3: Anticipatory Disk Scheduling.ppt

With enough requests…

issued by process A issued by process B

E.g., Throughput = 21 MB/s (IBM Deskstar disk)

time

location on disk

Page 4: Anticipatory Disk Scheduling.ppt

With synchronous I/O…

issued by process A issued by process B

forced!

too late!

E.g., Throughput = 5 MB/sNext

scheduleforced!

Page 5: Anticipatory Disk Scheduling.ppt

Deceptive idleness

Process A is about to issue next request.

but

Scheduler hastily assumes that process A has no further requests!

Page 6: Anticipatory Disk Scheduling.ppt

Proportional scheduler

Allocate disk service in say 1:2 ratio:

Deceptive idleness

causes 1:1 allocation:BA BA

Next

Page 7: Anticipatory Disk Scheduling.ppt

Prefetch

Overlaps computation with I/O.

Side-effect: avoids deceptive idleness!avoids deceptive idleness!

• Application-driven

• Kernel-driven

Page 8: Anticipatory Disk Scheduling.ppt

Prefetch

• Application driven – e.g. aio_read()

– Application need to know their future

– Cumbersome programming model– Cumbersome programming model

– Existing apps need re-writing

– May be less efficient than mmap

– aio_read() optional

Page 9: Anticipatory Disk Scheduling.ppt
Page 10: Anticipatory Disk Scheduling.ppt

Prefetch

• Kernel driven

– Less capable of knowing the future

– Access patterns difficult to predict, even – Access patterns difficult to predict, even with locality

– Cost of misprediction can be high

– Medium files too small to trigger sequential access detection

Page 11: Anticipatory Disk Scheduling.ppt

Anticipatory scheduling

Key idea: Sometimes wait for process whose request was last serviced.

Keeps disk idle for short intervals.

But with informed decisions, this:

• Improves throughput

• Achieves desired proportions

Page 12: Anticipatory Disk Scheduling.ppt

Cost-benefit analysis

Balance expected benefits of waiting

against cost of keeping disk idle.

Tradeoffs sensitive to scheduling policy

e.g., 1. seek optimizing scheduler

2. proportional scheduler

Page 13: Anticipatory Disk Scheduling.ppt

Statistics

For each process, measure:

1. Expected median and 95percentile thinktimeN

um

ber

of

2. Expected positioning time

Median 95percentile

Num

ber

of

requests

Thinktime

last next

Page 14: Anticipatory Disk Scheduling.ppt

Cost-benefit analysisfor seek optimizing scheduler

best := best available request chosen by scheduler

next := expected forthcoming request from

process whose request was last serviced

Benefit =

best.positioning_time — next.positioning_time

Cost = next.median_thinktime

Waiting_duration =

(Benefit > Cost) ? next.95percentile_thinktime : 0

Page 15: Anticipatory Disk Scheduling.ppt

Proportional scheduler

Costs and benefits are different.

e.g., proportional scheduler:

Wait for process whose request was last serviced,

1. if it has received less than its allocation, and

2. if it has thinktime below a threshold (e.g., 3ms)

Waiting_duration = next.95percentile_thinktime

Page 16: Anticipatory Disk Scheduling.ppt

Experiments

• FreeBSD-4.3 patch+ kernel module

(1500 lines of C code)

• 7200 rpm IDE disk (IBM Deskstar)

• Also in the paper:

15000 rpm SCSI disk (Seagate Cheetah)

Page 17: Anticipatory Disk Scheduling.ppt

Microbenchmark

20

25

Thro

ughput (M

B/s

)

OriginalAnticipatory

no prefetch prefetch

0

5

10

15

Sequential Alternate Random within file

Thro

ughput (M

B/s

)

no prefetch

no prefetch

prefetch

prefetch

Page 18: Anticipatory Disk Scheduling.ppt

Real workloads

What’s the impact on real applications and benchmarks?

Andrew benchmark

Apache web server(large working set)

Database benchmark

• Disk-intensive

• Prefetching enabled

Page 19: Anticipatory Disk Scheduling.ppt

Andrew filesystem benchmark

20

25

30

Execu

tio

n t

ime (

min

ute

s)

Original

5

6

2 (or more) concurrent clients

Loweris

better

Overall 8% performance improvement

0

5

10

15

20

mkdir cp stat scan gcc

-16% -5% -5% -54% +1.7%

Execu

tio

n t

ime (

min

ute

s)

Original

Anticipatory

better

Page 20: Anticipatory Disk Scheduling.ppt

Apache web server

3

4

Thro

ughput (M

B/s

)• CS.Berkeley trace

• Large working set

0

1

2

read

+29%

mmap

+71%

Thro

ughput (M

B/s

)

no prefetch

• 48 web clients

Page 21: Anticipatory Disk Scheduling.ppt

90

120

Thro

ughput (tra

nsactions/s

ec)

Database benchmark

•MySQL DB

•Two clients

0

30

60

Update

One DB

+2%

Update

Two DBs

+30%

Select

One DB

+5%

Select

Two DBs

+60%

Thro

ughput (tra

nsactions/s

ec)

•One or two databases on same disk

Page 22: Anticipatory Disk Scheduling.ppt

GnuLD

8

10

12

Execution tim

e (seconds)

Original

Anticipatory

Backup

0

2

4

6

One instance Two instances

Execution tim

e (seconds)

Anticipatory

Concurrent: 68% execution time reduction

Page 23: Anticipatory Disk Scheduling.ppt

Intelligent adversary

15

20

25

Th

rou

gh

pu

t (M

B/s

)

Original

Anticipatory

no prefetch

0

5

10

15

0 1 2 3 4 5 6 8 10 12

Number of reqests issued per cycle

Th

rou

gh

pu

t (M

B/s

)

20%

Page 24: Anticipatory Disk Scheduling.ppt

Proportional scheduler

20

Serv

ice r

eceiv

ed (

second

s)

30

60

90

120

Thro

ugh

put (t

ps)

0

10

0 10 20 30

Experimental time (seconds)

Serv

ice r

eceiv

ed (

second

s)

Original Anticipatory

0Thro

ugh

put (t

ps)

Database benchmark: two databases, select queries

Page 25: Anticipatory Disk Scheduling.ppt

Conclusion

Anticipatory scheduling:

• overcomes deceptive idleness• overcomes deceptive idleness

• achieves significant performance improvement on real applications

• achieves desired proportions

• and is easy to implement!

Page 26: Anticipatory Disk Scheduling.ppt

Anticipatory Disk SchedulingAnticipatory Disk Scheduling

Sitaram Iyer Peter Druschel

http://www.cs.rice.edu/~ssiyer/r/antsched/