Sunteți pe pagina 1din 35

CS 414 Multimedia Systems Design

Lecture 31 Media Server (Part 1)


Klara Nahrstedt Spring 2012

Covered Aspects of Multimedia


Image/Video Capture
Audio/Video Perception/ Playback Audio/Video Presentation Playback

Image/Video Information Representation

Transmission
Audio Capture Compression Processing

Transmission

Audio Information Representation

Media Server Storage

A/V Playback
3

Outline
Media Server Requirements Media Server Layered Architecture Disk scheduling algorithms

Client/Server Video-on-Demand System

Video-on-Demand Systems must be designed with goals:


Avoid starvation Minimize buffer space requirement Minimize initiation latency (video startup time) Optimize cost

Media Server Requirements

Real-time storage and retrieval


Media

quanta must be presented using the same timing sequence with which they were captured

High-Data Transfer Rate and Large Storage Space


HDTV

quality: 1280x720 pixels/frame; 24 bits/pixel -> 81 Mbytes per second NTCS quality: 640x480 pixels/frame; 24 bits/pixel ->27MBytes per seconds
7

YouTube Video Server (2010)


http://tech.fortune.cnn.com/2010/05/17/yo utube-at-5-years-old-2-billion-served-perday/ May 2010, 2 Billion videos served per day More than 24 hours of video uploaded every minute Videos usually less than 10 minutes long

YouTube Video Server (2011)

Over 4 B videos are viewed a day 60 hours of video are uploaded every minute Over 800 million unique users visit YouTube each month 70% of YouTube traffic comes from outside US In 2011, YouTube had more than 1 trillion views (140 views for every person on Earth)

Source: http://www.youtube.com/t/press_statistics
9

Video Playback Issues

Single Stream Playback


Possible

approach buffer the whole stream approach prefetch just short video part

Problem:?? Problem:

Possible

Prevent starvation Minimize buffer space requirement Minimize initiation latency

Multiple Streams Playback


Possible

approach dedicate a disk to each stream


approach multiple streams per disk
10

Problem: ?? Problems: ??

Possible

Media Server Architecture


Delivered data Incoming request Network Attachment Content Directory/Distribution Memory Management File System Storage management Disk control - scheduling Storage device
11

Storage Device- Disk Layout


Traditional Random Access Disk Layout Track Zoned Disk (ZBR Zone Bit Recording)

Sector Advantage: Easy mapping of location Information to head movement and disk rotation Problem: loss of storage space Advantage: Sector size same Rotation speed constant; efficient Usage of space
12

Storage/Disk Management

Optimal placement of MM data blocks


Single

disk multiple disks

Timely disk scheduling algorithms and sufficient buffers to avoid jitter Possible Admission control

13

Storage Management

Storage access time to read/write disk block is determined by 3 components


Seek

Time

Time required for the movement of read/write head

Rotational

Time (Latency Time)

Time during which transfer cannot proceed until the right block or sector rotates under read/write head

Data

Transfer Time

Time needed for data to copy from disk into main memory

14

Impact of Access Time Metrics


If data blocks are arbitrarily placed If requests are served on FCFC basis Then effort for locating data place may cost time period in order of magnitude 10ms This performance degrades disk efficiency Need techniques to reduce seek, rotation and transmission times !!!

15

MM Data Placement on Single Disk

Continuous Placement Simple to implement, but subject to fragmentation Enormous copying overhead during insert/delete to maintain continuity When reading file, only one seek required to position the disk head at the start of data

Non-contiguous Placement Avoids fragmentation Avoid copying overhead When reading file, seek operation incurs for each block , hence intrafile seek
16

Intra-file Seek Time


Intra-file seek can be avoided in noncontiguous layout if the amount read from a stream always evenly divides block Solution: select sufficient large block and read one block in each round

If

more than one block is required to prevent starvation prior to next read, deal with intrafile seek

Solution: constrained placement or logstructure placement

17

Non-continuous Placement

18

Constrained Placement

Approach: separation between successive file blocks is bounded


on separation not enforced for each pair of successive blocks, but only on average over finite sequence of blocks Attractive for small block sizes Implementation expensive
Bound

For constrained latency to yield full benefit, scheduling algorithm must retrieve immediately all blocks for a given stream before switching to another stream
19

Log-Structure Placement

This approach writes modified blocks sequentially in a large contiguous space, instead of requiring seek for each block in stream when writing (recording)
Reduction

of disk seeks Large performance improvements during recording, editing video and audio

Problem: bad performance during playback Implementation: complex


20

MM Data Placement at Multiple Disks


Data Interleaving On single disk (consecutive blocks are placed on The same cylinder But in interleaved way

Data Interleaving On Multiple Disks (Disks are not Synchronized) Striping data across Multiple disks
21

Disk Scheduling Policies

Goal of Scheduling in Traditional Disk Management


Reduce

cost of seek time Achieve high throughput Provide fair disk access

Goal of Scheduling in Multimedia Disk Management


Meet

deadline of all time-critical tasks Keep necessary buffer requirements low Serve many streams concurrently Find balance between time constraints and efficiency
22

Disk Scheduling Framework

Must support multiple QoS levels and requests

Source: Reddy et al, Disk Scheduling in a Multimedia I/O System, ACM TOMCCAP 2005 23

EDF (Earliest Deadline First) Disk Scheduling

Each disk block request is tagged with deadline


Very

good scheduling policy for periodic requests disk block request with earliest

Policy:
Schedule

deadline Excessive seek time high overhead Pure EDF must be adapted or combined with file system strategies 24

EDF Example

Note: Consider that block number Implicitly encapsulates the disk track number
25

SCAN-EDF Scheduling Algorithm


Combination of SCAN and EDF algorithms Each disk block request tagged with augmented deadline

Add

to each deadline perturbation

Policy:
SCAN-EDF

chooses the earliest deadline If requests with same deadline, then choose request according to scan direction
26

Implementation of SCAN-EDF

Notation:
be deadline of disk block request i Ni be track (block) position on disk Nmax be maximum number of disk tracks
Di

Deadline Modification:
Di

+ f(Ni) f(Ni) converts track number of i into a small perturbation of deadline Perturbation small enough so that

Di + f(Ni) Dj + f(Nj) for Di Dj Possible f(Ni) = Ni/Nmax


27

SCAN EDF Example (Nmax = 100)

28

Enhanced SCAN-EDF (1)


Use more accurate perturbation of deadline Consider


track position of disk head N Nmax max number of disk tracks Ni next track to be considered
Actual
Head Moves Upwards

29

Enhanced SCAN-EDF (2)

Algorithm: If head moves upwards (towards Nmax), then (a)

Ni N N i ; N N i N m ax, f ( N i ) N m ax

(b)

N m ax N i N i ;1 N i N , f ( N i ) N m ax
30

Enhanced SCAN-EDF (3)


If head moves downwards (towards 1), then Ni (a) N i ; N N i N m ax : f ( N i )

N m ax N Ni (b) N i ;1 N i N : f ( N i ) N m ax

31

Group Sweeping Algorithms

Policy:
Each

Request consists of (Deadline, Block Number ) Disk Block Requests served in cycles In one cycle, requests divided into groups according to similar deadlines Within group use SCAN As we retrieve blocks, we may need smoothing buffers to ensure continuity
32

Group Sweeping Example

33

Mixed Scheduling
(uses SSTF Shortest Seek Time First)
Example of SSTF

34

Mixed Scheduling
SSTF (Shortest Seek Time First) + Balanced Strategy

35

Conclusion
Media Server Architecture Storage Management

Data/file

placement on single disk Data/file placement on multiple disks

Disk Scheduling important component in the timely delivery of streams Admission should be done if one cares not to over subscribe

36

S-ar putea să vă placă și