cs 414 - spring 2012 cs 414 – multimedia systems design lecture 31 – media server (part 1) klara...

36
CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Upload: evan-norton

Post on 21-Jan-2016

222 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

CS 414 - Spring 2012

CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1)

Klara Nahrstedt

Spring 2012

Page 2: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Administrative MP2 posted MP2 Deadline – April 7, Saturday, 5pm.

CS 414 - Spring 2012

Page 3: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Covered Aspects of Multimedia

Image/VideoCapture

MediaServerStorage

Transmission

CompressionProcessing

Audio/VideoPresentationPlaybackAudio/Video

Perception/ Playback

Audio InformationRepresentation

Transmission

AudioCapture

A/V Playback

Image/Video InformationRepresentation

CS 414 - Spring 2012

Page 4: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Outline

Media Server Requirements Media Server Layered Architecture

CS 414 - Spring 2012

Page 5: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Client/Server Video-on-Demand System

CS 414 - Spring 2012

Page 6: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Video-on-Demand Systems must be designed with goals: Avoid starvation Minimize buffer space requirement Minimize initiation latency (video startup

time) Optimize cost

CS 414 - Spring 2012

Page 7: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

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 SpaceHDTV quality: 1280x720 pixels/frame; 24 bits/pixel -

> 81 Mbytes per secondNTCS quality: 640x480 pixels/frame; 24 bits/pixel -

>27MBytes per seconds

CS 414 - Spring 2012

Page 8: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

YouTube Video Server (2010)

http://tech.fortune.cnn.com/2010/05/17/youtube-at-5-years-old-2-billion-served-per-day/

May 2010, 2 Billion videos served per day More than 24 hours of video uploaded

every minute Videos usually less than 10 minutes long

CS 414 - Spring 2012

Page 9: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

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)

CS 414 - Spring 2012

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

Page 10: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Video Playback Issues Single Stream Playback

Possible approach – buffer the whole stream Problem:??

Possible approach – prefetch just short video part Problem:

Prevent starvation Minimize buffer space requirement Minimize initiation latency

Multiple Streams Playback Possible approach – dedicate a disk to each stream

Problem: ??

Possible approach – multiple streams per disk Problems: ??

CS 414 - Spring 2012

Page 11: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Media Server Architecture

CS 414 - Spring 2012

Storage device

Disk control - scheduling

Storage management

File System

Memory Management

Content Directory/Distribution

Network Attachment

Incoming requestDelivered data

Page 12: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Storage Device- Disk Layout

CS 414 - Spring 2012

Track

Sector

Zoned Disk (ZBR – ZoneBit Recording) Traditional Random Access

Disk Layout

Advantage: Easy mapping of location Information to head movement and disk rotation Problem: loss of storage space

Advantage: Sector size sameRotation speed constant; efficient Usage of space

Page 13: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Storage/Disk Management

Optimal placement of MM data blocks Single diskmultiple disks

Timely disk scheduling algorithms and sufficient buffers to avoid jitter

Possible Admission control

CS 414 - Spring 2012

Page 14: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Storage Management Storage access time to read/write disk

block is determined by 3 componentsSeek 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

CS 414 - Spring 2012

Page 15: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

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 !!!

CS 414 - Spring 2012

Page 16: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

MM Data Placement on Single Disk

CS 414 - Spring 2012

Continuous Placement Non-contiguous Placement

Simple to implement, but subject to fragmentation

Avoids fragmentation

Enormous copying overhead during insert/delete to maintain continuity

Avoid copying overhead

When reading file, only one seek required to position the disk head at the start of data

When reading file, seek operation incurs for each block , hence intrafile seek

Page 17: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Intra-file Seek Time Intra-file seek – can be avoided in non-contiguous

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 intra-file seek Solution: constrained placement or log-structure

placement

CS 414 - Spring 2012

Page 18: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Non-continuous Placement

CS 414 - Spring 2012

Page 19: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Constrained Placement Approach: separation between successive file blocks

is bounded Bound 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

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

CS 414 - Spring 2012

Page 20: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

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

CS 414 - Spring 2012

Page 21: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

MM Data Placement at Multiple Disks

CS 414 - Spring 2012

Data InterleavingOn Multiple Disks(Disks are not Synchronized)Striping data across Multiple disks

Data InterleavingOn single disk(consecutive blocks are placed on The same cylinderBut in interleaved way

Page 22: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

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

CS 414 - Spring 2012

Page 23: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Disk Scheduling Framework Must support multiple QoS levels and requests

CS 414 - Spring 2012

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

Page 24: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

EDF (Earliest Deadline First) Disk Scheduling

Each disk block request is tagged with deadlineVery good scheduling policy for periodic requests

Policy: Schedule disk block request with earliest deadlineExcessive seek time – high overheadPure EDF must be adapted or combined with file

system strategies

CS 414 - Spring 2012

Page 25: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

EDF Example

CS 414 - Spring 2012

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

Page 26: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

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

CS 414 - Spring 2012

Page 27: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Implementation of SCAN-EDF Notation:

Di be deadline of disk block request ‘i’

Ni be track (block) position on disk

Nmax be maximum number of disk tracks

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

CS 414 - Spring 2012

Page 28: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

SCAN EDF Example (Nmax = 100)

CS 414 - Spring 2012

Page 29: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Enhanced SCAN-EDF (1) Use more accurate perturbation of deadline Consider

Actual track position of disk head ‘N’ Nmax – max number of disk tracks

Ni – next track to be considered

CS 414 - Spring 2012

Head Moves Upwards

Page 30: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Enhanced SCAN-EDF (2) Algorithm:

If head moves upwards (towards Nmax), then

(a)

(b)

CS 414 - Spring 2012

maxmax )(,;

N

NNNfNNNN iiii

max

max)(,1;N

NNNfNNN iiii

Page 31: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Enhanced SCAN-EDF (3) If head moves downwards (towards 1), then

(a)

(b)

CS 414 - Spring 2012

maxmax )(:;

N

NNfNNNN iiii

max

)(:1;N

NNNfNNN iiii

Page 32: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

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 deadlinesWithin group use SCANAs we retrieve blocks, we may need smoothing

buffers to ensure continuity

CS 414 - Spring 2012

Page 33: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Group Sweeping Example

CS 414 - Spring 2012

Page 34: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Mixed Scheduling (uses SSTF – Shortest Seek Time First)

CS 414 - Spring 2012

Example of SSTF

Page 35: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

Mixed Scheduling

CS 414 - Spring 2012

SSTF (Shortest Seek Time First) + Balanced Strategy

Page 36: CS 414 - Spring 2012 CS 414 – Multimedia Systems Design Lecture 31 – Media Server (Part 1) Klara Nahrstedt Spring 2012

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

CS 414 - Spring 2012