Sei sulla pagina 1di 34

Multimedia Operating Systems

Disk Scheduling
- Deterministic Approach Admission Control

- Statistical Approach - Observation-based Approach

- Scheduled Bottleneck Network-I/OMulticast - Periodic Broadcast - Dynamic Multicast - Hybrid Approach

Types of Interactive Services


[Little94]

Broadcast (No-VoD) Pay-per-view (PPV) Quasi VoD (Q-VoD): Users are grouped
based on a threshold of interests. Some VCR functions can be done by switching between groups.

Near VoD (N-VoD): Allows limited forward


and reverse.

True VoD: Users have complete control.

The notion of Real-Time in Multimedia


A real-time process is a process which delivers the results of the processing in given time-span.

The system must enforce externally-defined time constraints.

Speed and efficiency are not the main characteristics of a real-time system. The playback of a video sequence is only acceptable when it is presented neither too quickly nor too slowly.

Timing and logical dependencies among different related tasks, processed at the same time, also must be considered. Audio data sometimes must be synchronized with video data.

Real-Time Scheduling
To fulfill the timing requirements of continuous media, the operating system must use real-time scheduling technique. The scheduler must consider the entire end-to-end data path. The CPU is just one of the resources. Other components include main memory, storage, I/O devices and networks.
4

Multimedia File Systems


Conventional file systems: Provide no rate guarantees for data retrieval. Unsuitable for continuous media data. Continuous media file systems: Guarantee that once a request is accepted, data are retrieved at the requested rate.
5

Disk Scheduling: FCFS


t
24 30 16 50 42 45 12 12 40 22 24 30 16

Order of Requests

45 12 40

42 45 12

50 42 45

16 50 42

30 16 50

16 50

42 45

12 40

22 20

Or

equests atisfied r der of s

Advantages: Intrinsically fair Simple Disadvantages: Not optimal with respect to head movement. high average seek time.
6

Disk Scheduling: Shortest-SeekTime First (SSTF)


SSTF selects among all requests the one with the minimum seek time from the current head position.
24 30 16 50 42 45 12 12 40 22 30 16 50 24 30 16

Order of requests

45 12 40

42 45 40

50 42 45

16 50 45

30 50

45 42

. ..

40 12

22 20

Advantage: optimal in terms of seek time. Disadvantage: request targets in the middle of the disk are preferred over those in the innermost and outermost disk areas.

Starvation can occur.

Disk Scheduling: SCAN


Like SSTF, SCAN orders requests to minimize seek time. In contrast to SSTF, SCAN takes the direction of the current disk movement into account. It first serves all requests in one direction until it does not have any request in this direction anymore. The head movement is then reversed and service is 24 continued.
Order of requests
30 16 50 42 45 12 12 40 22 22 20 16 50 12 50 45 30 16 12 30 24 16 12 24

...

45 12 40 40

42 45 12 42

50 45 12

d Hea

rds pwa es u mov

es mov s d Hea nward dow

Note: Middle tracks still get a better service then edge tracks. 8

Disk Scheduling: C-SCAN


C-SCAN only retrieves data in one direction to ensure fairness.
One idle head movement from one edge to the other between two consecutive scans. Performance of C-SCAN is somewhat less than SCAN.
24 30 16 50 42 45 12 12 40 22 22 20

Order of requests

45 12 40 40

42 45 12 42

50 45 12 45

16 50 12 50

30 16 12 12

24 30 16 16

...

es mov d Hea ards upw

ards upw es mov d Hea

Earliest Deadline First (EDF)


t
3 24 3 30 2 16 3 50 2 16 3 50 2 42 1 45 1 12 2 40 1 22 12 2 2 20 1 12 2 40 45 1 45 2 40 40 2 42 2 40 42 3 50 2 42 16 3 30 2 16 3 50 50 3 24 3 30 3 50

Order of requests

2 42 1 45 1 12 2 40 1 22

.. .

R e q u e s t s w it h : d e a d lin e b lo c k n u m b e r

Employment of EDF in the strict sense results in poor throughput and excessive seek time.
10

SCAN-EDF : Algorithm
All requests are forced to have release times that are multiples of the period p.

All requests have deadlines that are multiple of the period p.

Like in EDF, the request with the earliest deadline is always served first. Among requests with the same deadline, the specific one that is first according to the scan IMPLEMENTATION direction is served first.

If Note: The function f prioritizesi tasks of the same Di is the deadline of task i and N is the track position,deadline according to their positions on disk. the deadline can be modified to be Di+f(Ni).
11

SCAN-EDF: Example
Nmax = 100 and f(Ni) = Ni / Nmax
t
3 .2 4 2 4 3 .3 0 3 0 2 .1 6 1 6 3 .5 0 5 0 2 .1 6 1 6 3 .5 0 5 0 2 .4 2 4 2 1 .4 5 4 5 1 .1 2 1 2 2 .4 0 4 0 1 .2 2 2 2 22 12 2 .4 0 4 0 1 .2 2 2 2 45 2 .4 0 4 0 1 .4 5 4 5 40 2 .4 2 4 2 2 .4 0 4 0 16 3 .5 0 5 0 2 .4 2 4 2 42 3 .3 0 3 0 3 .5 0 5 0 2 .4 2 4 2

Order of requests

2 .4 2 4 2 1 .4 2 4 5 1 .1 2 1 2 2 .4 0 4 0 1 .2 2 2 2

d e a d li n e 2

d e a d li n e 1

Note: The simple function f does not take into consideration of the current direction of the head movement.
12

SCAN-EDF: Advantage
EDF: Not optimal with respect to disk movement. SCAN: Not taking deadline into account. SCAN-EDF: Having the benefits of both EDF and SCAN.

13

Admission Control
R e q u e s ts

A d m is s io n C o n t r o lle r

Video files
M UX

3 . . .

. . .

S c h e d u le r

n c o n c u rre n t s tre a m s

An admission controller determines whether a new client can be admitted for service without disturbing the clients being served. Once the client is admitted, its requirements must be satisfied during the course of service. After a new client is admitted, the scheduler schedules the client of when and how it is served.
14

Admission Criterion
Service time is the total time spent retrieving media blocks of currently served clients for one round. Round duration is the minimum playback duration among the currently served clients for a round. The admission criterion is:
Service _ time Round _ duration
R e q u e s ts

A d m is s io n C o n t r o lle r

V id e o file s
M U X

. . . . . .

S c h e d u le r

n c o n c u rre n t s tre a m s

15

Admission Control: Goals


To service as many clients as possible per unit time (high throughput). To maintain a high utilization of the resources. To offer minimum latency for the clients.

16

Deterministic Admission Control


Different admission control techniques compute the service time differently. Deterministic approach assumes the worst-case scenarios in computing the service time.
Service _ time Round _ duration
Example: The service time for SCAN disk scheduling is computed as follows. service_ time = seek _ time_ per _ track max_ no_ of _ track

+ block _ retrieval_ time kj


j =1

block_retrieval_time = seek_time_per_track + max_rotational_delay + transfer_time_per_block


17

Deterministic Admission Control: Advantages


Advantages:

- The continuity requirements of each client are not violated during the entire course of their playback.

- The admission control algorithm is easy to implement. Disadvantages:

- The media server is underutilized since the average time for retrieving a block is usually much lower than the worst case value.
18

Admission Control: Statistical Approach


It extrapolates the average block retrieval time in future rounds based upon the history of the average retrieval times of the most W recent rounds.

It admits the client if the following criterion is satisfied:


Service _ time Round _ duration
n+1

Predicted_avg_retrieval_time

k Round_duration i i=1

19

Statistical Approach
Advantage:
The server resources are better utilized. As a result, throughput is significantly increased.

Disadvantages:

It does not provide absolute guarantee to the clients since the algorithm employs prediction.
There are overflow rounds. Several techniques can be applied to distribute the media loss among clients.

The algorithm is more complicated to implement.


20

Disk Stripping
An effective way to distribute the workload evenly across n disks is to stripe video files across the disks in a round-robin fashion.

The entire aggregate bandwidth of disks is available to show the most popular movies.

Unpopular movies do not render the disks that store them underutilized. Multiple concurrent streams of a video to be supported without having to replicate the video.

21

Data Stream
Transmitted information is divided into individual units (packets). Transmission of a sequence of individual packets forms a data stream.

Examples:

+ transmission of speech in a telephone system. + retrieval of a document from a 22 database server.

Characteristics of Data Streams


Asynchronous Transmission Mode: provides for communication with no timely restrictions.
Example: Internet protocol for email transmission.

Synchronous Transmission Mode: defines a maximum end-to-end delay for each packet of a data stream.
Needs a large temporary storage for packets arriving too early.

Iso-chronous Transmission Mode: defines, besides a maximum end-toend delay for each packet of a data stream, a minimum end-to-end delay.
The necessary storage of video data at the receiver can be significantly reduced. 23

Network-I/O Bottleneck
Traditional Data Processing

D a ta b a s e s e rv e r
D a ta F il t e r in g

D a ta b a s e

C o m m u n ic a ti o n n e tw o r k
N e tw o r k I / O S to r a g e I/ O ( b o ttle n e c k )

Multimedia Computing
C o m m u n i c a ti o n n e tw o r k

V id e o s e rv e r

V id e o f i le s
N e tw o r k I / O ( b o tt l e n e c k ) S to r a g e I / O

24

Types of Media
Discrete media (static media): Time is not part of the semantics of the media.
They may be displayed according to a wide variety of timing of even sequencing, and remain meaningful. Examples: text, graphics and images.

Continuous media (dynamic media): Time or more exactly time-dependency between information items, is part of the information itself.
If the timing is changed, or the sequencing of the items modified, the meaning is altered. Examples: sound or motion video.

Multimedia refers to a collection of media types used together. It implies that at least one media type is not text.
25

Approaches to Multimedia Delivery


I. Download and Play: Simplest; treat a
video file as an object; similar to the file transfer problem. From a video server: Simplest Problems: Long delays Scalability Copyright From your peer: (peer-to-peer network) such as Napster Scale better than the first approach Problems: Reliability Security Copyright Scalability: Ability to support a large number of users given the same system resources and capacity. 26

Video Streaming
At the video server
Each video i is associated with
Popularity (pi) between [0..1] Size (si) Playback rate (ri) such as 1.5Mbps for MPEG-1 video Data controller arranges data into packets and sends them out.

Disk scheduler retrieves data from a disk.

At the client
The client software must ensure that (i) the buffer is not empty; and (ii) the buffer is not overwritten. Negotiation must be done prior to the time the data is sent.

Decoder acts as a consumer

Receiver receives data from the remote server. The receiver acts as a producer
27

II. Video Streaming: Consider continuous


property. Reduce service delays Copyrights: Although video content is
viewed, the file itself is not distributed.

Continuous-property: Once a request is accepted, there is no interruption in the playback.

C o m m u n ic a ti o n n e tw o r k

V id e o s e rv e r

V id e o f i le s
N e tw o r k I / O ( b o tt l e n e c k ) S to r a g e I / O

Problems: Scalability
The bottleneck is due to the limitation of the server I/O bandwidth (min(disk I/O, com I/O)) and congestion of the network path to the server.

28

Performance Metrics
Goal: Minimize
Average service delay: Time since the
request is submitted to time the video playback can begin)

Average reneging probability or loss ratio or defection rate


di: defection rate for video i
di = # requests reneged for video i # requests for video i

dav: average defection rate for all videos


d av = # requests reneged # total requests

Unfairness (U)
U=

d
i =1

d av

m 1

m: number of videos

Average server load per request Average network load per request

29

User Interactions [Li96]


Play Pause/Resume Fast-forward/Resume Fast-reverse/Resume Fast-search/Reverse-search Slow-motion Jump forward/backward to a specific frame/Resume (no picture,sound needed during the jump) Think about how to support these operations if each user is allocated a dedicated stream!!!

Think about RealPlayer whether it supports these operations.

30

Interactive Models[Shin98]
F a st F orw ard S to p R e w in d
2

1
P ause

1 P
3

1
P la y / R e s u m e

1 -P 9 P
F a st S e a rch
7

P 1

A b ort

R eve rse S e a rch

S lo w M o t io n

Typically, these interactive requests are sent through a TCP connection (control channel). Video data is transmitted using UDP(User Datagram Protocol-connectionless broadcasting) packets (data channel).
31

Important Statistics
Zipf Distribution: If the videos are sorted
according to their access frequency, the access frequency of the video i (fi) is

c fi = i

where c is some constant

Zipf factor ( ), = 0.729 is typical for video rental Poisson Distribution : exponential distribution, such as the number of telephone calls at a business or the number of accidents at an intersection

32

User Behavior Models


User Tolerance Models Minimum Reneging Time: The wait time (W) is W = Rmin + Exponential( ), where is an exponentially distributed random variable. Maximum Wait Time Guarantee: Users specify only the maximum waiting time. Other User Tolerance Models W=Normal( , ) [Aggarwal96] W=Exponential( ) Request Arrivals: Poisson distribution is popularly used.
33

Addressing Scalability Problems


Cluster-based Video Servers
Adv: Reduce server I/O bottleneck Disadv: Network path to the clustered servers is the bottleneck.

Distributed Video Server Adv: Reduce server I/O bottleneck,


network path bottleneck DisAdv: Expensive due to maintenance

Utilize multicast
Adv: Reduce server I/O comm. bottleneck New problems: Challenge to support interactive services.

Utilize distributed public cooperative caches Adv: Reduce server I/O bottleneck,
reduce network load. Disadv: Expensive due to maintenance
34

Potrebbero piacerti anche