Date post: | 28-Dec-2015 |
Category: |
Documents |
Upload: | theodora-poole |
View: | 216 times |
Download: | 0 times |
1
Multimedia Storage Issues
NUS.SOC.CS5248OOI WEI TSANG
2
Media vs. Documents
large file sizewrite once, read manydeadlines!
3
OS Review: Disk
NUS.SOC.CS5248OOI WEI TSANG
4
Disk
head, spindle, track, sector, cylinderseek time, rotational latency
NUS.SOC.CS5248OOI WEI TSANG
5
Disk Scheduler
disksched
I/O Request
read/write command
6
Disk Scheduling Algorithm
NUS.SOC.CS5248OOI WEI TSANG
7
Best Effort Scheduler
FCFS: First come first serveSSTF: Shortest seek time firstSCAN: Serve all requests in one
direction, then in the other direction
C-SCAN: Serve all requests in one direction only, then “jump” back to the other end and repeat.
NUS.SOC.CS5248OOI WEI TSANG
8
Other Schemes
EDF: Earliest deadline first EDF-SCAN: Use SCAN to schedule
request with same deadline. FD-SCAN: SCAN towards direction
with earliest feasible deadline SSEDO: Rank request by deadline and
use formula (seektime*rank) SSEDV: Use formula (lifetime* +
seektime*(1- )
9
Data Placement
NUS.SOC.CS5248OOI WEI TSANG
10
Contiguous
NUS.SOC.CS5248OOI WEI TSANG
11
Fragmented
NUS.SOC.CS5248OOI WEI TSANG
12
Stripping (RAID-0)
NUS.SOC.CS5248OOI WEI TSANG
13
Mirroring (RAID-1)
NUS.SOC.CS5248OOI WEI TSANG
14
Parity (RAID-5)
NUS.SOC.CS5248OOI WEI TSANG
15
Parity
NUS.SOC.CS5248OOI WEI TSANG
16
Summary of Concerns
High ThroughputFault TolerantLoad balancing
NUS.SOC.CS5248OOI WEI TSANG
17
Design Parameters
unit of striping (block size)degree of striping (num of disks)
NUS.SOC.CS5248OOI WEI TSANG
18
Stripe Unit
NUS.SOC.CS5248OOI WEI TSANG
19
Stripe Unit
NUS.SOC.CS5248OOI WEI TSANG
20
Effects of Block Size
Block Size
servicetime
NUS.SOC.CS5248OOI WEI TSANG
21
Problem
Find block size such that the service time for the most heavily loaded disk is minimize
NUS.SOC.CS5248OOI WEI TSANG
22
Analysis Model: A Plan
service time of the busiest disk as a function of block size
expected num of blocks accessed on the busiest disk
expected num of blocks accessed on any disk
NUS.SOC.CS5248OOI WEI TSANG
23
Assumptions
Non-redundant arrayAnalyze read operation only
NUS.SOC.CS5248OOI WEI TSANG
24
Variables Declaration
Nd: Number of Disks
Nc: Number of ClientsB : Block sizeNb(i,j): Number of blocks client i
access from disk jNb(i,*): Total number of blocks
client i access
NUS.SOC.CS5248OOI WEI TSANG
25
Analysis
Suppose i request m blocks
NUS.SOC.CS5248OOI WEI TSANG
26
Reading 1 block
Prob(Nb(i,j)=1)
1
1
1
)),((
)),((
D
D
N
m D
DDb
N
m Db
N
mNmNjiNP
N
mmjiNP
NUS.SOC.CS5248OOI WEI TSANG
27
Reading k block
Prob(Nb(i,j)=k)
1
1
1
)),((
))1(),((
D
D
N
m D
DDb
N
m DDb
N
mNmkNjiNP
N
mmNkjiNP
NUS.SOC.CS5248OOI WEI TSANG
28
Total Num of Blocks from Disk j
Nb(*,j) =
CN
ib jiN
1
),(
NUS.SOC.CS5248OOI WEI TSANG
29
Busiest Disk
Nmax = )(*,max..0
jNDNj
NUS.SOC.CS5248OOI WEI TSANG
30
Access Time
T = Nmax(ts + tr + Btt)
Depends on:block size Bdisk characteristic ts,tr,tt
server design Nd
workload characteristic Nc, N(i,j)_
NUS.SOC.CS5248OOI WEI TSANG
31
Model Verification
ServiceTime
Block Size
NUS.SOC.CS5248OOI WEI TSANG
32
Imbalance and Overhead
I = 1 – Tavg/Tmax
O = 1 – NmaxBTt/Tmax
NUS.SOC.CS5248OOI WEI TSANG
33
Effects of Block Size
Block Size
Imbalance
Overhead
~optimum
NUS.SOC.CS5248OOI WEI TSANG
34
Effects of Clients
Block Size
Imbalance
Overhead
Nc incr, I decr, opt B incr
NUS.SOC.CS5248OOI WEI TSANG
35
Effects of Clients
BlockSize
Nc
NUS.SOC.CS5248OOI WEI TSANG
36
Effects of Num of Disks
Nd incr, N(i,j) decr, I incr, opt B decrBlockSize
Nd
NUS.SOC.CS5248OOI WEI TSANG
37
Choosing Block Size
Given Nc, assume rest is fixed find B that minimize T
if T < duration of a round incr Nc and try again
NUS.SOC.CS5248OOI WEI TSANG
38
There is more..
redundant arrayfinding optimum degree of
striping
39
Cello: Disk Scheduler
NUS.SOC.CS5248OOI WEI TSANG
40
Problem
How to co-exist with other applications?
NUS.SOC.CS5248OOI WEI TSANG
41
Classes of ApplicationsReal-time
hard/softperiodic/aperiodic
Best-effortinteractivetroughput-intensive
NUS.SOC.CS5248OOI WEI TSANG
42
Attempt 1
Priority-based schedulerAlways schedule real-time tasks
ahead of best-effort tasks
NUS.SOC.CS5248OOI WEI TSANG
43
Attempt 2
Partition time slots into real-time and best-effort
NUS.SOC.CS5248OOI WEI TSANG
44
Attempt 3
Assign weight to application class, based on their priority
Service based on weight
NUS.SOC.CS5248OOI WEI TSANG
45
Attempt 3: Cello
Two-level scheduling
NUS.SOC.CS5248OOI WEI TSANG
46
Class Independent Scheduler
NUS.SOC.CS5248OOI WEI TSANG
47
Allocating Disk BandwidthAllocate in proportion to timeAllocate in proportion to bytes
NUS.SOC.CS5248OOI WEI TSANG
48
Notations
P : Interval of a roundI : Total idle time so far in this
roundUi : Time allocated so far to class
iwi : Weight for class iW : Total weight for all class
NUS.SOC.CS5248OOI WEI TSANG
49
Proportionate Time-Allocation
Ui < P-I
NUS.SOC.CS5248OOI WEI TSANG
50
Proportional Time Allocation
Ui < (P-I)wi/W
NUS.SOC.CS5248OOI WEI TSANG
51
Example
Weights 1:1:2P = 100I = 30
10 20 16 14
NUS.SOC.CS5248OOI WEI TSANG
52
Pick a class i which is underutilized, i.e.
Ui < (P-I)wi/W
NUS.SOC.CS5248OOI WEI TSANG
53
r
next
prev
Class specific schedule will return a request to be inserted,plus to location in the scheduled queue for insertion.(r, prev, next)
NUS.SOC.CS5248OOI WEI TSANG
54
Need to Make Sure..
Does not exceed share for class i
Ui + T < (P-I)wi/W
service time for new request
NUS.SOC.CS5248OOI WEI TSANG
55
Need to Make Sure..
Total service time does not exceed available time
Ui + T + T’next – Tnext < P-I
NUS.SOC.CS5248OOI WEI TSANG
56
Update and Repeat
next
prev
NUS.SOC.CS5248OOI WEI TSANG
57
What if..
a class have no pending request?put in no_work group
a class violates one of the constraints?put in too_much_work group
NUS.SOC.CS5248OOI WEI TSANG
58
Improving Utilization
When disk is idle, distribute service time among classes in too_much_work group
Pick a request from this class and put into scheduled queue
NUS.SOC.CS5248OOI WEI TSANG
59
Free Time Utilization
NUS.SOC.CS5248OOI WEI TSANG
60
Class Specific SchedulerHow to pick (r, prev, next)?
NUS.SOC.CS5248OOI WEI TSANG
61
Slack Time
li = Latest time you must begin servicing request i
ei = Earliest time you may begin servicing request i
di = Deadline for request i
si = Slack time for i = li - ei
NUS.SOC.CS5248OOI WEI TSANG
62
Slack Time
li = min(di, li+1) – Ti
ei = ei-1 + Ti-1
Special case when request is at the beginning of queue or end of queue.
NUS.SOC.CS5248OOI WEI TSANG
63
Slack Time
i
i
NUS.SOC.CS5248OOI WEI TSANG
64
Class 1: Interactive Best Effort
next
prev
pick r at front of pending queue, insert into earliest positionin scheduled queue without violating deadlines of others.
NUS.SOC.CS5248OOI WEI TSANG
65
Class 2: High Throughput Best Effort
next
prev
pick r at front of pending queue, insert into tail of scheduled queue. Order consecutive best effort request by SCAN order.
NUS.SOC.CS5248OOI WEI TSANG
66
Class 3: Real Time Application
next
prev
pick r in EDF order. Insert into scheduled queue such that it will meet its deadline and will not violate deadlines of others
NUS.SOC.CS5248OOI WEI TSANG
67
Evaluations
responsetimeof besteffortapp
# video
SCAN
Cello
NUS.SOC.CS5248OOI WEI TSANG
68
Evaluations
%bandwidth
time
50%
No video
text app
video app
NUS.SOC.CS5248OOI WEI TSANG
69
Cello Summary
OS disk schedulerSupport multiple classesProtect classes from each otherWork conservingUse two-level scheduling