26
Predicting Real-time Service-level Metrics from Device Statistics Stockholm, Oct 21, 2015 Rerngvit Yanggratoke (1) (1) KTH Royal Institute of Technology, Sweden (2) Ericsson Research, Sweden (3) Swedish Institute of Computer Science (SICS), Sweden 1 Machine Learning meetup at Spotify In collaboration with Jawwad Ahmed (2) , John Ardelius (3) , Christofer Flinta (2) , Andreas Johnsson (2) , Zuoying Jiang (1) , Daniel Gillblad (3) , Rolf Stadler (1)

20151021_DataScienceMeetup_revised

Embed Size (px)

Citation preview

Page 1: 20151021_DataScienceMeetup_revised

Predicting Real-time Service-level Metrics from Device Statistics

Stockholm, Oct 21, 2015

Rerngvit Yanggratoke(1)

(1) KTH Royal Institute of Technology, Sweden(2) Ericsson Research, Sweden

(3) Swedish Institute of Computer Science (SICS), Sweden

1

Machine Learning meetup at Spotify

In collaboration withJawwad Ahmed(2), John Ardelius(3), Christofer Flinta(2),

Andreas Johnsson(2), Zuoying Jiang(1), Daniel Gillblad(3), Rolf Stadler(1)

Page 2: 20151021_DataScienceMeetup_revised

About Me• Currently, PhD student at KTH

• “Real-time analytics for network management”

– Apply machine learning on system-generated data to better manage networked services and systems

• Favorite data science tools

– R for data analysis and visualization

– SparkR for large-scale batch processing

• Free time

– Playing foosball and badminton

– Developing and playing mobile games

– Contributing to Opensource projects: Flink and SparkR2

Page 3: 20151021_DataScienceMeetup_revised

Overview

3

Hardware

Operating System

Services

Device statistics X

Real-time service metrics Y

- CPU load, memory load, #network active sockets, #context switching, #processes, etc..

- We read raw data from /procprovided by Linux kernel

- Video frame rate, web response time, read latency, map/reduce job completion time, ….

Predict

….

Page 4: 20151021_DataScienceMeetup_revised

Outline

• Problem / motivation

• Device statistics X

• Service-level metrics Y

• Testbed setup

• X-Y traces

• Data cleaning and preprocessing

• Evaluation results

• Real-time analytics engine

• Demo

• Recap4

Page 5: 20151021_DataScienceMeetup_revised

Problem : M: X➝ Ŷ predicts Y in real-time

Problem / motivation

Motivation :• Building block for real-time service assurance for a service

operator or infrastructure provider

- CPU load, memory load, #network active sockets, #context switching, #processes, etc..

- Video frame rate, audio buffer rate, RTP packet rate

- We select Video streaming (VLC) as an example service

5

X: device statisticsY: service-level metrics

Service (S): Cluster

Network

Service (S): Client

[Supervised-learning regression problem]

Page 6: 20151021_DataScienceMeetup_revised

Device statistics Xproc and Xsar

• Linux kernel statistics Xproc

– Features extracted from /proc directory

– CPU core jiffies, current memory usage, virtual memory statistics, #processes, #blocked processes, …

– About 4,000 metrics

• System Activity Report (SAR) Xsar

– SAR computes metrics from /proc over time interval

– CPU core utilization, memory and swap space utilization, disk I/O statistics, …

– About 840 metrics

• Xproc contains many OS counters, while Xsar does not

• For model predictions, include numerical features

6

Page 7: 20151021_DataScienceMeetup_revised

Service-level metrics Y

• Video streaming service based on VLC media player

• Measured metrics

– Video frame rate (frames/sec)

– Audio buffer rate (buffers/sec)

– RTP packet rate (packets/sec)

– …

• We instrumented the VLC software to capture

underlying events to compute the metrics.

7

Page 8: 20151021_DataScienceMeetup_revised

X4 Sensor

Server machineServer machine

X3 Sensor

HTTP Load balancer

Video streaming(HTTP)

Transcodinginstance

X6 Sensor

Server machine

Transcoding instance

Video Streaming(HTTP)

X5 Sensor

Server machine

Transcoding instance

Network File System

X1 Sensor

Server machine

File systemaccess

Network File System

X2 Sensor

Server machine

Web Server

Web Server

Web Server

Server-side

Page 9: 20151021_DataScienceMeetup_revised

VLC Client

VLC Sensor

(Y1)

X4 Sensor

Server machine

Client machine

Load generator

VLC ClientVoD Load generator

Server machine

X3 Sensor

HTTP Load balancer

Video streaming(HTTP)

Transcodinginstance

X6 Sensor

Server machine

Transcoding instance

Video Streaming(HTTP)

X5 Sensor

Server machine

Transcoding instance

Network File System

X1 Sensor

Server machine

File systemaccess

Network File System

X2 Sensor

Server machine

Web Server

Web Server

Web Server

Server-side Client-side

Page 10: 20151021_DataScienceMeetup_revised

X-Y traces for evaluation

We collect the following traces

– Periodic-load trace, flashcrowd-load trace, constant-load trace, poisson-load trace, linearly-increasing-load trace

10

We published the traces use in our workshttp://mldata.org/repository/data/viewslug/realm-im2015-vod-traces/http://mldata.org/repository/data/viewslug/realm-cnsm2015-vod-traces/

Page 11: 20151021_DataScienceMeetup_revised

Data cleaning and preprocessing

• Cleaning– Removal of non-numeric features

– Removal of highly correlated features

– Removal of constant features

– …

• Preprocessing options– Principal component analysis

• Dimensionality reduction

– Incorporate historical data (X = [Xt, Xt-1, …, Xt-k])

– *Automatic feature selection

– ….11

Page 12: 20151021_DataScienceMeetup_revised

Evaluation

Model training and evaluation

X-Y trace

Train setTest set

70%

30%

Model training

Linear regressionRegression treeRandom forestLasso regression

….

Learning modelLearning

modelLearning model

ei = | yi - yi |

NMAE =1

ymei

i=1

m

å

Prediction accuracy

yi =M(xi )

yiMeasure

Training Time

12

Normalized Mean Absolute Error

Page 13: 20151021_DataScienceMeetup_revised

13

Video frame rate

• Y – bimodal distribution• Both methods provide

similar prediction errors

Method NMAE (%)

Linear regression 12

Regression tree 11

Page 14: 20151021_DataScienceMeetup_revised

Audio buffer rate

14

• Y – bimodal distribution• Regression tree outperforms

least-square linear regression

Method NMAE (%)

Linear regression 41

Regression tree 19

Page 15: 20151021_DataScienceMeetup_revised

RTP packet rate

15

• Y – wider spread distribution• Least-square linear regression

outperforms regression tree

Method NMAE (%)

Linear regression 15

Regression tree 19

Page 16: 20151021_DataScienceMeetup_revised

Evaluation results – periodic-load traceDevice

statistics Regression methodNMAE (%)

Video Audio RTP

X_proc

Linear regression 26 59 39

Lasso regression 23 63 35

Regression tree 23 61 36

Random forest 22 60 34

X_sar

Linear regression 12 41 15

Lasso regression 16 51 17

Regression tree 11 19 19

Random forest 6 0.94 15 16

Page 17: 20151021_DataScienceMeetup_revised

Lessons learned

• Appropriate models depend on the service metrics

• It is feasible to accurately predict client-side metrics based on low-level device statistics– NMAE below 15% across service-level metrics and traces

• Preprocessing of X is critical

– X_sar outperforms X_proc

– Significant improvement of prediction accuracy

• There is a trade-off between computational resources vs. prediction accuracy

– Random forest vs. linear regression

17

Page 18: 20151021_DataScienceMeetup_revised

Automatic feature selection

• Exhaustive search is infeasible

– Requires O(2p) training executions (p = ~5000)

• Forward stepwise feature selection

– Heuristic method O(p2) training executions

– Start with an empty set

– Incrementally grows the feature set with one feature at a time that minimizes a specific evaluation metric

• Selected metric is the cross-validation error

18

Page 19: 20151021_DataScienceMeetup_revised

Random forest on different feature sets

19

TraceFeature set

Video Audio

NMAE (%) Training(secs)

NMAE(%) Training(secs)

Periodic-load

Full 12 > 50000 32 > 70000

Automaticallyoptimized feature set

6 862 22 1600

Flash-load

Full 8 > 55000 21 > 75000

Automaticallyoptimized feature set

4 778 15 1750

* Learning with the optimized feature set significantly improve prediction accuracy and reduce training time

Page 20: 20151021_DataScienceMeetup_revised

Real-time Analytics Engine

20

Page 21: 20151021_DataScienceMeetup_revised

Hardware

Linux OS

Service (S): Server

Xsar = ~5000 metrics

Network

preprocessing

Service (S): Client

Y1 = video frame rate

Y2 = audio buffer rate

Y3 = network read rate

Computing Prediction

Models

Y1 =M1 X( )

Y2 =M2 X( )

Y3 =M3 X( )

Predict

Predict

Predict

Historical Y

Page 22: 20151021_DataScienceMeetup_revised

Recorded Demo

22

Page 23: 20151021_DataScienceMeetup_revised

23

Page 24: 20151021_DataScienceMeetup_revised

Recap

• Design and develop experimental testbeds

• Run experiments with various load patterns

• Collected and published traces

• Machine learning model assessment– Batch learning on traces

– Online learning on traces

– Real-time learning on live statistics

• Design and develop real-time analytics engine

• Implement a prototype for real-time learning on live statistics

24

Page 25: 20151021_DataScienceMeetup_revised

Key-value store (Voldemort)

25

Page 26: 20151021_DataScienceMeetup_revised

Questions?

26