+ All Categories
Home > Documents > Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12:...

Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12:...

Date post: 22-Aug-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
93
PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland 2nd March 2017 Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku
Transcript
Page 1: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Performance Modelling — Lecture 12:PEPA Case Study: Rap Genius on Heroku

Jane Hillston & Dimitrios MiliosSchool of Informatics

The University of EdinburghScotland

2nd March 2017

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 2: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Introduction

As an example of a realistic case study, we consider aPlatform as a Service (PaaS) system, Heroku, and study itsbehaviour under different policies for assigning client jobs toleased servers.

This case study has been developed by Dimitrios Milios.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 3: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

HerokuCloud computing describes hardware or software resources madeavailable as a service-on-demand, typically over the Internet.

There are different service models:

Infrastructure as a Service (IaaS): computing resources, includingactual hardware or virtualised computers, storage,bandwidth or other resources.

Platform as a Service (PaaS): provides a customised solutionstack, including operating systems, programminglanguages, libraries, web servers, databases andsoftware tools.

Software as a Service (SaaS) depends on both IaaS and PaaS, andprovides access to remote software applications in amanner completely transparent to the end user.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 4: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

HerokuCloud computing describes hardware or software resources madeavailable as a service-on-demand, typically over the Internet.

There are different service models:

Infrastructure as a Service (IaaS): computing resources, includingactual hardware or virtualised computers, storage,bandwidth or other resources.

Platform as a Service (PaaS): provides a customised solutionstack, including operating systems, programminglanguages, libraries, web servers, databases andsoftware tools.

Software as a Service (SaaS) depends on both IaaS and PaaS, andprovides access to remote software applications in amanner completely transparent to the end user.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 5: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Heroku and dynos

Heroku is a PaaS provider offering an integrated frameworkenabling developers to deploy and support web-basedapplications. Several programming languages are supported.

Clients upload the source code for their application, togetherwith a file that describes the software dependencies.

The Heroku platform then builds the application, which willbe executed on one or more virtualised machines, which areknown as dynos.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 6: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Heroku and dynos

Heroku is a PaaS provider offering an integrated frameworkenabling developers to deploy and support web-basedapplications. Several programming languages are supported.

Clients upload the source code for their application, togetherwith a file that describes the software dependencies.

The Heroku platform then builds the application, which willbe executed on one or more virtualised machines, which areknown as dynos.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 7: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Heroku and dynos

Heroku is a PaaS provider offering an integrated frameworkenabling developers to deploy and support web-basedapplications. Several programming languages are supported.

Clients upload the source code for their application, togetherwith a file that describes the software dependencies.

The Heroku platform then builds the application, which willbe executed on one or more virtualised machines, which areknown as dynos.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 8: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Web dynos and worker dynos

According to the on-line Heroku specification documents1, adyno is a lightweight environment running a single commandat a time.

This functionality is implemented by an isolated virtualisedserver.

Dynos are claimed to provide a secure andperformance-consistent environment to run an application.

There are two kinds of dynos available:

web dynos which respond to HTTP requests, andworker dynos which execute background jobs.

1https://devcenter.heroku.com/

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 9: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Web dynos and worker dynos

According to the on-line Heroku specification documents1, adyno is a lightweight environment running a single commandat a time.

This functionality is implemented by an isolated virtualisedserver.

Dynos are claimed to provide a secure andperformance-consistent environment to run an application.

There are two kinds of dynos available:

web dynos which respond to HTTP requests, andworker dynos which execute background jobs.

1https://devcenter.heroku.com/

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 10: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Web dynos and worker dynos

According to the on-line Heroku specification documents1, adyno is a lightweight environment running a single commandat a time.

This functionality is implemented by an isolated virtualisedserver.

Dynos are claimed to provide a secure andperformance-consistent environment to run an application.

There are two kinds of dynos available:

web dynos which respond to HTTP requests, andworker dynos which execute background jobs.

1https://devcenter.heroku.com/

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 11: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Web dynos and worker dynos

According to the on-line Heroku specification documents1, adyno is a lightweight environment running a single commandat a time.

This functionality is implemented by an isolated virtualisedserver.

Dynos are claimed to provide a secure andperformance-consistent environment to run an application.

There are two kinds of dynos available:

web dynos which respond to HTTP requests, andworker dynos which execute background jobs.

1https://devcenter.heroku.com/

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 12: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Concurrency and scalability

Commands are non-interruptable; thus concurrency isachieved by employing more than one dyno.

Increasing the number of web dynos will increase theconcurrency of HTTP requests, while more worker dynosprovide more capacity for processes running in thebackground.

Therefore, all the client has to do is to upload the source codeof the application and scale it to a number of dynos.

When a service request appears, Heroku is responsible forassigning it to one of the dynos leased by the client, followinga routing policy.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 13: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Concurrency and scalability

Commands are non-interruptable; thus concurrency isachieved by employing more than one dyno.

Increasing the number of web dynos will increase theconcurrency of HTTP requests, while more worker dynosprovide more capacity for processes running in thebackground.

Therefore, all the client has to do is to upload the source codeof the application and scale it to a number of dynos.

When a service request appears, Heroku is responsible forassigning it to one of the dynos leased by the client, followinga routing policy.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 14: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Concurrency and scalability

Commands are non-interruptable; thus concurrency isachieved by employing more than one dyno.

Increasing the number of web dynos will increase theconcurrency of HTTP requests, while more worker dynosprovide more capacity for processes running in thebackground.

Therefore, all the client has to do is to upload the source codeof the application and scale it to a number of dynos.

When a service request appears, Heroku is responsible forassigning it to one of the dynos leased by the client, followinga routing policy.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 15: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Concurrency and scalability

Commands are non-interruptable; thus concurrency isachieved by employing more than one dyno.

Increasing the number of web dynos will increase theconcurrency of HTTP requests, while more worker dynosprovide more capacity for processes running in thebackground.

Therefore, all the client has to do is to upload the source codeof the application and scale it to a number of dynos.

When a service request appears, Heroku is responsible forassigning it to one of the dynos leased by the client, followinga routing policy.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 16: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The basic structure of Heroku6.1. Cloud Services 125

Figure 6.2: The basic structure of Heroku

client. Such an outcome is not improbable at all; in fact, we shall report a particular

incident which has inspired the current case study.

Rap Genius2 is a website that aims to provide a critical and artistic insight into the

lyrics of rap songs. The cultural contribution of Rap Genius is remarkable, however, in

terms of the current poetically sterile thesis, we shall focus on some technical aspects

only. The website users have access to content via HTTP requests, and they are able to

add annotations to content. Rap Genius makes this service available via the cloud, and

Heroku in particular.

In the beginning of 2013, Rap Genius reported unusually long average response

times, despite the large number of dynos leased by the website3. The average response

time reported by the Heroku platform was as low as 40 ms, while the response time

experienced by the users has been 6330 ms. This difference has been attributed to the

fact that the requests are waiting in the local queues of the dynos. Therefore, given that

the actual service has not been any slower than usual, this could suggest that the system

has simply been overloaded. Nevertheless, according to Rap genius, there has not been

2http://rapgenius.com/3http://rapgenius.com/James-somers-herokus-ugly-secret-lyrics

We will investigate the routing policy performance.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 17: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Heroku routing policies

Two routing policies have historically been used by Heroku:

Random Routing — a new request is directed to arandomly-selected web dyno. The premise of random routingis that the load is balanced across the dynos in the long term.

Smart Routing — the availability of each dyno is tracked andthe load is directed accordingly, thus minimising the numberof idle dynos.

Although explicit information on the implementation of thesepolicies is not available, it is straightforward to model the desiredbehaviour for each policy at a high-level.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 18: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Heroku routing policies

Two routing policies have historically been used by Heroku:

Random Routing — a new request is directed to arandomly-selected web dyno. The premise of random routingis that the load is balanced across the dynos in the long term.

Smart Routing — the availability of each dyno is tracked andthe load is directed accordingly, thus minimising the numberof idle dynos.

Although explicit information on the implementation of thesepolicies is not available, it is straightforward to model the desiredbehaviour for each policy at a high-level.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 19: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Determining the number of dynos needed

Each client must determine how many dynos should be leased.

This depends on the workload: the heavier the workload is,the more dynos will be needed.

In the ideal case, every service should be tailored to the needsof the corresponding client.

Typically, clients may have a rough idea of the expectedworkload. However, they may find it difficult to accuratelyestimate the number of the machines needed.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 20: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Determining the number of dynos needed

Each client must determine how many dynos should be leased.

This depends on the workload: the heavier the workload is,the more dynos will be needed.

In the ideal case, every service should be tailored to the needsof the corresponding client.

Typically, clients may have a rough idea of the expectedworkload. However, they may find it difficult to accuratelyestimate the number of the machines needed.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 21: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Determining the number of dynos needed

Each client must determine how many dynos should be leased.

This depends on the workload: the heavier the workload is,the more dynos will be needed.

In the ideal case, every service should be tailored to the needsof the corresponding client.

Typically, clients may have a rough idea of the expectedworkload. However, they may find it difficult to accuratelyestimate the number of the machines needed.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 22: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Determining the number of dynos needed

Each client must determine how many dynos should be leased.

This depends on the workload: the heavier the workload is,the more dynos will be needed.

In the ideal case, every service should be tailored to the needsof the corresponding client.

Typically, clients may have a rough idea of the expectedworkload. However, they may find it difficult to accuratelyestimate the number of the machines needed.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 23: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Applying performance modelling techniques

Performance modelling is a natural way to produce suchestimates in a rigorous manner.

Despite the fact that modelling relies on rather strongassumptions, if done appropriately it can provide us withuseful insight into the behaviour of a system.

Even just having some expectations about the system canhelp the client to detect when something has gone wrong.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 24: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Applying performance modelling techniques

Performance modelling is a natural way to produce suchestimates in a rigorous manner.

Despite the fact that modelling relies on rather strongassumptions, if done appropriately it can provide us withuseful insight into the behaviour of a system.

Even just having some expectations about the system canhelp the client to detect when something has gone wrong.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 25: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Applying performance modelling techniques

Performance modelling is a natural way to produce suchestimates in a rigorous manner.

Despite the fact that modelling relies on rather strongassumptions, if done appropriately it can provide us withuseful insight into the behaviour of a system.

Even just having some expectations about the system canhelp the client to detect when something has gone wrong.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 26: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Rap Genius/Genius

Genius2 (formerly known as Rap Genius3) is a website thataims to provide a critical and artistic insight into the lyrics ofrap songs.

The cultural contribution of Genius is remarkable, however, interms of the current poetically sterile course, we shall focus onsome technical aspects only.

The website users have access to content via HTTP requests,and they are able to add annotations to content.

Genius makes this service available via Heroku.

2http://genius.com/3http://rapgenius.com/

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 27: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Rap Genius/Genius

Genius2 (formerly known as Rap Genius3) is a website thataims to provide a critical and artistic insight into the lyrics ofrap songs.

The cultural contribution of Genius is remarkable, however, interms of the current poetically sterile course, we shall focus onsome technical aspects only.

The website users have access to content via HTTP requests,and they are able to add annotations to content.

Genius makes this service available via Heroku.

2http://genius.com/3http://rapgenius.com/

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 28: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Rap Genius/Genius

Genius2 (formerly known as Rap Genius3) is a website thataims to provide a critical and artistic insight into the lyrics ofrap songs.

The cultural contribution of Genius is remarkable, however, interms of the current poetically sterile course, we shall focus onsome technical aspects only.

The website users have access to content via HTTP requests,and they are able to add annotations to content.

Genius makes this service available via Heroku.

2http://genius.com/3http://rapgenius.com/

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 29: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Rap Genius/Genius

Genius2 (formerly known as Rap Genius3) is a website thataims to provide a critical and artistic insight into the lyrics ofrap songs.

The cultural contribution of Genius is remarkable, however, interms of the current poetically sterile course, we shall focus onsome technical aspects only.

The website users have access to content via HTTP requests,and they are able to add annotations to content.

Genius makes this service available via Heroku.

2http://genius.com/3http://rapgenius.com/

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 30: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The problem experienced

In the beginning of 2013, Rap Genius reported unusually longaverage response times, despite the large number of dynosleased by the website.

The average response time reported by the Heroku platformwas as low as 40 ms, while the response time experienced bythe users had been 6330 ms.

This difference was attributed to requests waiting in the localqueues at the dynos.

Therefore, given that the actual service had not been anyslower than usual, this suggested that the system had simplybeen overloaded.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 31: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The problem experienced

In the beginning of 2013, Rap Genius reported unusually longaverage response times, despite the large number of dynosleased by the website.

The average response time reported by the Heroku platformwas as low as 40 ms, while the response time experienced bythe users had been 6330 ms.

This difference was attributed to requests waiting in the localqueues at the dynos.

Therefore, given that the actual service had not been anyslower than usual, this suggested that the system had simplybeen overloaded.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 32: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The problem experienced

In the beginning of 2013, Rap Genius reported unusually longaverage response times, despite the large number of dynosleased by the website.

The average response time reported by the Heroku platformwas as low as 40 ms, while the response time experienced bythe users had been 6330 ms.

This difference was attributed to requests waiting in the localqueues at the dynos.

Therefore, given that the actual service had not been anyslower than usual, this suggested that the system had simplybeen overloaded.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 33: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The problem experienced

In the beginning of 2013, Rap Genius reported unusually longaverage response times, despite the large number of dynosleased by the website.

The average response time reported by the Heroku platformwas as low as 40 ms, while the response time experienced bythe users had been 6330 ms.

This difference was attributed to requests waiting in the localqueues at the dynos.

Therefore, given that the actual service had not been anyslower than usual, this suggested that the system had simplybeen overloaded.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 34: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Diagnosing the problem

Nevertheless, according to Rap Genius, there had not beenany significant change in the workload, which had been ashigh as 9000 requests per minute.

Eventually, this considerable increase in the response time wasblamed on the fact that the Heroku routing policy has beenchanged from smart to random4.

Here, our objective is not to assess the quality of serviceprovided by Heroku, or recreate the situation experienced byRap Genius. Instead, we demonstrate how modelling withPEPA can capture the effect of different routing policies.

4http://www.wired.com/2013/03/hieroku

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 35: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Diagnosing the problem

Nevertheless, according to Rap Genius, there had not beenany significant change in the workload, which had been ashigh as 9000 requests per minute.

Eventually, this considerable increase in the response time wasblamed on the fact that the Heroku routing policy has beenchanged from smart to random4.

Here, our objective is not to assess the quality of serviceprovided by Heroku, or recreate the situation experienced byRap Genius. Instead, we demonstrate how modelling withPEPA can capture the effect of different routing policies.

4http://www.wired.com/2013/03/hieroku

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 36: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Diagnosing the problem

Nevertheless, according to Rap Genius, there had not beenany significant change in the workload, which had been ashigh as 9000 requests per minute.

Eventually, this considerable increase in the response time wasblamed on the fact that the Heroku routing policy has beenchanged from smart to random4.

Here, our objective is not to assess the quality of serviceprovided by Heroku, or recreate the situation experienced byRap Genius. Instead, we demonstrate how modelling withPEPA can capture the effect of different routing policies.

4http://www.wired.com/2013/03/hieroku

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 37: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Heroku configuration considered6.2. Modelling Heroku Routing with PEPA 127

Figure 6.3: The Heroku configuration considered

Table 6.1: The rate values used in the examples

Variable Name Value (sec�1)

rrequest [40, 60, 150]

rweb 8

rmigrate 1

rworker 4

rresponse 20

rassign 500

both cases, we assume that service is broken down in two parts: the actual service and

the response. The actual service part covers the amount of work that a dyno needs to

produce a result. The service time depends on the type of the job. While both types of

dynos are identical with respect to their computational capabilities, the worker dynos

deal with more demanding tasks, which is reflected in a lower service rate. Therefore

the average web service time is 1/rweb = 0.125 sec, while for the worker dyno services

we have an average time of 1/rworker = 0.25 sec. The response part represents the time

needed by a dyno to transmit the results to the user. It is considered to be identical

in both cases, as it only depends on the network. Moreover, response takes place at a

considerably higher rate than the actual service, so it has rate rresponse = 20.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 38: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Modelling assumptions

We assume the web requests arrive at the router in a Poissonstream.

The router component is responsible for forwarding eachrequest to a web dyno.

When a web dyno receives a request, there are twopossibilities:

it can either service the request directly orcreate a new request to be serviced by a worker dyno.

In the latter case, the current job will migrate from a webdyno to a worker dyno, and the router is responsible forredirecting the request accordingly.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 39: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Modelling assumptions

We assume the web requests arrive at the router in a Poissonstream.

The router component is responsible for forwarding eachrequest to a web dyno.

When a web dyno receives a request, there are twopossibilities:

it can either service the request directly orcreate a new request to be serviced by a worker dyno.

In the latter case, the current job will migrate from a webdyno to a worker dyno, and the router is responsible forredirecting the request accordingly.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 40: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Modelling assumptions

We assume the web requests arrive at the router in a Poissonstream.

The router component is responsible for forwarding eachrequest to a web dyno.

When a web dyno receives a request, there are twopossibilities:

it can either service the request directly orcreate a new request to be serviced by a worker dyno.

In the latter case, the current job will migrate from a webdyno to a worker dyno, and the router is responsible forredirecting the request accordingly.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 41: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Modelling assumptions

We assume the web requests arrive at the router in a Poissonstream.

The router component is responsible for forwarding eachrequest to a web dyno.

When a web dyno receives a request, there are twopossibilities:

it can either service the request directly orcreate a new request to be serviced by a worker dyno.

In the latter case, the current job will migrate from a webdyno to a worker dyno, and the router is responsible forredirecting the request accordingly.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 42: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Modelling assumptions and parameters

Migration from a web dyno to a worker dyno is the only way aworker dyno may be accessed, as the users are assumed toproduce HTTP requests only.

The generation of a worker request captures the possibilitythat a job may require some background computation.

It is assumed that the fraction requests that are migrated issmall; more specifically, we consider a migration probabilityequal to 1/9.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 43: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Activity types

We can identify some activity types representing behaviour inour model, regardless of the routing policy.

These activities are request, assign,web,migrate,worker andresponse and each will be associated with an exponentiallydistributed duration.

The request arrival rate r request will control the assumedworkload in the system.

This is the variable we are going to experiment with, so it willtake values within a range from 40 to 150 sec−1, whichcorresponds to 9000 requests per minute.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 44: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Rate values

Variable Name Value (sec−1)

r request [40, 60, 150]

rweb 8

rmigrate 1

rworker 4

r response 20

rassign 500

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 45: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Service rates and dynos

While both types of dynos are identical with respect to theircomputational capabilities, the worker dynos deal with moredemanding tasks, which is reflected in a lower service rate.

Therefore the average web service time is 1/rweb = 0.125 sec,while for the worker dyno services we have an average time of1/rworker = 0.25 sec.

The response part represents the time needed by a dyno totransmit the results to the user. It is considered to beidentical in both cases, as it only depends on the network.

Moreover, response takes place at a considerably higher ratethan the actual service, so it has rate r response = 20.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 46: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Migration and migration probability

It is assumed that there is a race condition between migrationand web service.

Thus, the rate of migration will control the migrationprobability.

By considering rmigrate = 1 and given that we have rweb = 8,we impose a migration probability equal to 1/9.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 47: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Assignment of jobs to dynos

Finally, it is assumed that assignment happens almostinstantaneously, since it depends only on the resourcesallocated to the routing component.

It is fair to expect that any decision will take place veryquickly based on the current state of the system.

This is reflected by the high rate rassign = 500, or 2milliseconds average duration.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 48: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

PEPA model

In the following, we present two PEPA models that implementthe two routing policies.

We assume that each dyno has its own queue, thus we areinterested in observing how the local dyno queues are affectedby each policy.

In the PEPA models we have components for the web dynos,the worker dynos, and the system router which keeps queuesfor requests coming from the web and migration requests fromthe web dynos for the worker dynos.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 49: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Random Routing Policy

A dyno can be idle, occupied or with one or more requests inits local queue.

According to the random routing policy, the router randomlyassigns jobs to dynos, regardless of their state.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 50: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

PEPA components

Web dynos are represented by components WebDyno i , wherethe subscript i denotes the number of requests in the localdyno queue.

For WebDyno i , three activities are possible; service representsthe main web service part, whose completion proceeds to theresponse stage, carried out by WebDyno ia. Since a responsecannot be interrupted, no new job can be assigned orenqueued at this point.

The migrate activity generates a migration request anddecreases the queue length at this web dyno.

Finally, the assignweb activity adds a request to the queuefrom the client.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 51: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

PEPA components

Web dynos are represented by components WebDyno i , wherethe subscript i denotes the number of requests in the localdyno queue.

For WebDyno i , three activities are possible; service representsthe main web service part, whose completion proceeds to theresponse stage, carried out by WebDyno ia. Since a responsecannot be interrupted, no new job can be assigned orenqueued at this point.

The migrate activity generates a migration request anddecreases the queue length at this web dyno.

Finally, the assignweb activity adds a request to the queuefrom the client.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 52: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

PEPA components

Web dynos are represented by components WebDyno i , wherethe subscript i denotes the number of requests in the localdyno queue.

For WebDyno i , three activities are possible; service representsthe main web service part, whose completion proceeds to theresponse stage, carried out by WebDyno ia. Since a responsecannot be interrupted, no new job can be assigned orenqueued at this point.

The migrate activity generates a migration request anddecreases the queue length at this web dyno.

Finally, the assignweb activity adds a request to the queuefrom the client.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 53: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

PEPA components

Web dynos are represented by components WebDyno i , wherethe subscript i denotes the number of requests in the localdyno queue.

For WebDyno i , three activities are possible; service representsthe main web service part, whose completion proceeds to theresponse stage, carried out by WebDyno ia. Since a responsecannot be interrupted, no new job can be assigned orenqueued at this point.

The migrate activity generates a migration request anddecreases the queue length at this web dyno.

Finally, the assignweb activity adds a request to the queuefrom the client.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 54: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebDyno component in PEPA

WebDynodef= (assignweb,>).WebDyno0

WebDynoidef= (service, rweb).WebDyno ia+ (migrate, rmigrate).WebDyno i−1

+ (assignweb,>).WebDyno i+1

WebDyno iadef= (response, rresponse).WebDyno i−1

Idle and busy states

WebDyno i and WebDyno ia represent the two stages of a webservice. In both cases, the web dyno is considered to be occupied.The idle state is denoted by WebDyno.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 55: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebDyno component in PEPA

WebDynodef= (assignweb,>).WebDyno0

WebDynoidef= (service, rweb).WebDyno ia+ (migrate, rmigrate).WebDyno i−1

+ (assignweb,>).WebDyno i+1

WebDyno iadef= (response, rresponse).WebDyno i−1

Idle and busy states

WebDyno i and WebDyno ia represent the two stages of a webservice. In both cases, the web dyno is considered to be occupied.The idle state is denoted by WebDyno.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 56: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebDyno component in PEPA

WebDynodef= (assignweb,>).WebDyno0

WebDynoidef= (service, rweb).WebDyno ia+ (migrate, rmigrate).WebDyno i−1

+ (assignweb,>).WebDyno i+1

WebDyno iadef= (response, rresponse).WebDyno i−1

Idle and busy states

WebDyno i and WebDyno ia represent the two stages of a webservice. In both cases, the web dyno is considered to be occupied.The idle state is denoted by WebDyno.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 57: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebDyno component in PEPA

WebDynodef= (assignweb,>).WebDyno0

WebDynoidef= (service, rweb).WebDyno ia+ (migrate, rmigrate).WebDyno i−1

+ (assignweb,>).WebDyno i+1

WebDyno iadef= (response, rresponse).WebDyno i−1

Idle and busy states

WebDyno i and WebDyno ia represent the two stages of a webservice. In both cases, the web dyno is considered to be occupied.The idle state is denoted by WebDyno.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 58: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebDyno component in PEPA

WebDynodef= (assignweb,>).WebDyno0

WebDynoidef= (service, rweb).WebDyno ia+ (migrate, rmigrate).WebDyno i−1

+ (assignweb,>).WebDyno i+1

WebDyno iadef= (response, rresponse).WebDyno i−1

Idle and busy states

WebDyno i and WebDyno ia represent the two stages of a webservice. In both cases, the web dyno is considered to be occupied.The idle state is denoted by WebDyno.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 59: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebDyno component in PEPA

WebDynodef= (assignweb,>).WebDyno0

WebDynoidef= (service, rweb).WebDyno ia+ (migrate, rmigrate).WebDyno i−1

+ (assignweb,>).WebDyno i+1

WebDyno iadef= (response, rresponse).WebDyno i−1

Idle and busy states

WebDyno i and WebDyno ia represent the two stages of a webservice. In both cases, the web dyno is considered to be occupied.The idle state is denoted by WebDyno.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 60: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WorkerDyno component in PEPA

The worker dynos have a similar but simpler structure, as in thiscase there is no job migration option.

WorkerDynodef= (assignworker ,>).WorkerDyno0

WorkerDynoidef= (service, rworker ).WorkerDyno ia+ (assignworker ,>).WorkerDyno i+1

WorkerDyno iadef= (response, rresponse).WorkerDyno i−1

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 61: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WorkerDyno component in PEPA

The worker dynos have a similar but simpler structure, as in thiscase there is no job migration option.

WorkerDynodef= (assignworker ,>).WorkerDyno0

WorkerDynoidef= (service, rworker ).WorkerDyno ia+ (assignworker ,>).WorkerDyno i+1

WorkerDyno iadef= (response, rresponse).WorkerDyno i−1

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 62: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WorkerDyno component in PEPA

The worker dynos have a similar but simpler structure, as in thiscase there is no job migration option.

WorkerDynodef= (assignworker ,>).WorkerDyno0

WorkerDynoidef= (service, rworker ).WorkerDyno ia+ (assignworker ,>).WorkerDyno i+1

WorkerDyno iadef= (response, rresponse).WorkerDyno i−1

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 63: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WorkerDyno component in PEPA

The worker dynos have a similar but simpler structure, as in thiscase there is no job migration option.

WorkerDynodef= (assignworker ,>).WorkerDyno0

WorkerDynoidef= (service, rworker ).WorkerDyno ia+ (assignworker ,>).WorkerDyno i+1

WorkerDyno iadef= (response, rresponse).WorkerDyno i−1

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 64: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Routing

The routing component is characterised by a set of states thatdenote the number of requests in the router queue.

In any state, the router can accept a web request or amigration request, and add it to the router queue.

If one or more jobs are in the queue, the router will attemptto direct them to any of the web or worker dynos, dependingon the type of the request.

It is convenient to model the router as two queues, one foreach type of dyno.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 65: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebRouter component

WebRouter0def= (request, rrequest).WebRouter1

WebRouteridef= (request, rrequest).WebRouter i+1

+ (assignweb, rassign).WebRouter i−1

WebRouterndef= (request, rrequest).WebRoutern+ (assignweb, rassign).WebRoutern−1

where n denotes the maximum size for the corresponding queue.

Overflow behaviourIf the maximum size is reached, it is assumed that any newrequests will be discarded until the queue is not full.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 66: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebRouter component

WebRouter0def= (request, rrequest).WebRouter1

WebRouteridef= (request, rrequest).WebRouter i+1

+ (assignweb, rassign).WebRouter i−1

WebRouterndef= (request, rrequest).WebRoutern+ (assignweb, rassign).WebRoutern−1

where n denotes the maximum size for the corresponding queue.

Overflow behaviourIf the maximum size is reached, it is assumed that any newrequests will be discarded until the queue is not full.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 67: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebRouter component

WebRouter0def= (request, rrequest).WebRouter1

WebRouteridef= (request, rrequest).WebRouter i+1

+ (assignweb, rassign).WebRouter i−1

WebRouterndef= (request, rrequest).WebRoutern+ (assignweb, rassign).WebRoutern−1

where n denotes the maximum size for the corresponding queue.

Overflow behaviourIf the maximum size is reached, it is assumed that any newrequests will be discarded until the queue is not full.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 68: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WebRouter component

WebRouter0def= (request, rrequest).WebRouter1

WebRouteridef= (request, rrequest).WebRouter i+1

+ (assignweb, rassign).WebRouter i−1

WebRouterndef= (request, rrequest).WebRoutern+ (assignweb, rassign).WebRoutern−1

where n denotes the maximum size for the corresponding queue.

Overflow behaviourIf the maximum size is reached, it is assumed that any newrequests will be discarded until the queue is not full.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 69: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WorkerRouter component

WorkerRouter0def= (migrate,>).WorkerRouter1

WorkerRouteridef= (migrate,>).WorkerRouter i+1

+ (assignworker , rassign).WorkerRouter i−1

WorkerRouterndef= (migrate,>).WorkerRoutern+ (assignworker , rassign).WorkerRoutern−1

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 70: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WorkerRouter component

WorkerRouter0def= (migrate,>).WorkerRouter1

WorkerRouteridef= (migrate,>).WorkerRouter i+1

+ (assignworker , rassign).WorkerRouter i−1

WorkerRouterndef= (migrate,>).WorkerRoutern+ (assignworker , rassign).WorkerRoutern−1

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 71: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Random WorkerRouter component

WorkerRouter0def= (migrate,>).WorkerRouter1

WorkerRouteridef= (migrate,>).WorkerRouter i+1

+ (assignworker , rassign).WorkerRouter i−1

WorkerRouterndef= (migrate,>).WorkerRoutern+ (assignworker , rassign).WorkerRoutern−1

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 72: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Smart routing policy

In the smart routing case, the dyno components are similar tothose in the random routing case, as both web and workerdynos have the same states and the same rates.

The only difference is that we now have two distinct actiontypes for assigning a job to a dyno.

We want to capture the fact that a job may be either assignedto an idle dyno, or enqueued to an occupied dyno.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 73: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Smart WebDyno component in PEPA

For the web dynos, only a WebDyno component will now be able toperform an assignweb activity, as it denotes that the dyno is idle.

WebDynodef= (assignweb,>).WebDyno0

WebDynoidef= (service, rweb).WebDyno ia+ (migrate, rmigrate).WebDyno i−1

+ (enqueueweb,>).WebDyno i+1

WebDynoia remains unchanged.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 74: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Smart WorkerDyno component in PEPA

Similarly, an assignworker activity can only be performed byWorkerDyno, while for the WorkerDyno i component we have onlyservice and enqueueworker

WorkerDynodef= (assignworker ,>).WorkerDyno0

WorkerDynoidef= (service, rworker ).WorkerDyno ia+ (enqueueworker ,>).WorkerDyno i+1

WorkerDynoia remains unchanged.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 75: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Representing smart routing in PEPA

Smart routing directs a request to an available dyno.

If more than one dyno is available, then the router willrandomly select a dyno.If there are no dynos available, the request will be randomlyenqueued to any dyno.

The routing algorithm has a deterministic step: the dynoavailability check. Our model probabilistically favoursassigning jobs to free dynos over placing them in queues.

The idea is that the router will delay directing a request untila dyno is available.

If too many requests arrive, then the router will decrease itsqueue length by directing the requests to random dynos.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 76: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Smart WebRouter component

We assume that the WebRouter component has a maximum queuelength of n. Then for any queue length i < n, the requests areassigned to web dynos that can perform an assignweb activity; i.e.the dyno is currently idle.

WebRouter0def= (request, rrequest).WebRouter1

WebRouteridef= (request, rrequest).WebRouter i+1

+ (assignweb, rassign).WebRouter i−1

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 77: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Smart WebRouter component

If the queue length reaches its maximum size n, this means that nodyno has been available for a long time.

It is then acceptable to send the request to the queue of any dynothus WebRoutern will either assign or enqueue a request.

WebRouterndef= (request, rrequest).WebRoutern+ (assignweb, rassign × 0.5).WebRoutern−1

+ (enqueueweb, rassign × 0.5).WebRoutern−1

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 78: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

The Smart WorkerRouter component

Analogously, the migration queue on the router side will bemodified as follows:

WorkerRouter0def= (migrate,>).WorkerRouter1

WorkerRouteridef= (migrate,>).WorkerRouter i+1

+ (assignworker , rassign).WorkerRouter i−1

WorkerRouterndef= (migrate,>).WorkerRoutern+ (assignworker , rassign × 0.5).WorkerRoutern−1

+ (enqueueworker , rassign × 0.5).WorkerRoutern−1

where n denotes the maximum queue length, and 0 < i < n.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 79: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Summary

When the queue of the router is not full, then the routerworks according to its “smart” mode of operation — it directsany requests to idle dynos only.

New requests wait in the router queue before being assigned.

However, if the router queue reaches maximum capacity, thisis an indication that the system is congested, suggesting thatthere are no idle dynos available.

The router will then enter its “random” mode of operation,and will decrease its queue by randomly directing requests toany dyno; enqueueweb and enqueueworker can only beperformed if the corresponding router queue is full.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 80: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Evaluation of routing policies

We experimentally evaluate how the routing policies respondto different workloads.

We consider a system featuring eight web dynos and eightworker dynos. We have two models that implement the tworouting policies; these are Random8:8 and Smart8:8.

The models have been solved for their transient andsteady-state behaviour.

The Random8:8 model has 3, 920, 400 states and took 10, 250seconds for steady state solution and 39, 000 seconds fortransient analysis.The Smart8:8 model has 3, 849, 444 states and took 11, 370seconds for steady state solution and 43, 000 seconds fortransient solution.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 81: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Evaluation of routing policies

We experimentally evaluate how the routing policies respondto different workloads.

We consider a system featuring eight web dynos and eightworker dynos. We have two models that implement the tworouting policies; these are Random8:8 and Smart8:8.

The models have been solved for their transient andsteady-state behaviour.

The Random8:8 model has 3, 920, 400 states and took 10, 250seconds for steady state solution and 39, 000 seconds fortransient analysis.The Smart8:8 model has 3, 849, 444 states and took 11, 370seconds for steady state solution and 43, 000 seconds fortransient solution.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 82: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Experimentation with the workload

We experimented with two different values for the requestrate 40 and 60, in order to observe how the two routingpolicies respond to different workloads.

The effects of each policy are reflected in the average dynoqueue length and in the number of dynos that remain idle.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 83: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Random8:8 and Smart8:8 results for rrequest = 406.3. Evaluation of Routing Policies 137

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(a) Random routing (Original)

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(b) Smart routing (Original)

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(c) Random routing (Quasi-lumpability)

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(d) Smart routing (Quasi-lumpability)

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(e) Random routing (NCD)

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(f) Smart routing (NCD)

Figure 6.6: Random8:8 and Smart8:8 results for rrequest = 40

To summarise, the smart routing policy results in better utilisation of the system

resources compared to random routing, judging by the number of requests that remain

in the queues at the dyno level. Smart routing results in a significantly shorter average

queue length, regardless of the workload.

Applying compositional aggregation, and the quasi-lumpability approach in partic-

(a) Random routing (b) Smart routing

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 84: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Comments on the results

The results show that part of the system is underused for bothsmart and random routing, as there are a significant numberof idle dynos in both cases.

However, the average dyno queue lengths are noticeablyhigher for random routing which means that some requestsmight be waiting in the queue while there are dynos available.

That is not the case for smart routing however, where thedyno queues are almost empty.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 85: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Increasing the request rate

We investigated how the routing policies are affected by ahigher workload, by increasing the request arrival rateto 60 per second, or 3600 requests per minute.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 86: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Random8:8 and Smart8:8 results for rrequest = 60138 Chapter 6. Case Study on Cloud Computing

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(a) Random routing (Original)

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(b) Smart routing (Original)

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(c) Random routing (Quasi-lumpability )

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(d) Smart routing (Quasi-lumpability)

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(e) Random routing (NCD)

0

1

2

3

4

5

6

7

8

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(f) Smart routing (NCD)

Figure 6.7: Random8:8 and Smart8:8 results for rrequest = 60

ular, has led us to the same conclusion at a significantly lower cost. However, the NCD-

based approach has been considerably less accurate compared to the quasi-lumpability

approach for the Heroku example. In fact, both approaches rely on assumptions that

may or may not hold for a specific model. One assumption is that there is a partition of

the state-space with respect to which the model is either quasi-lumpable or nearly com-

(a) Random routing (b) Smart routing

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 87: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Comments on the results

Here, the system usage is similar for both random and smartrouting.

For the smart system, the dyno queues have significantlyshorter length when compared to the random routing policy,implying that the requests wait less time for service.

To summarise, the smart routing policy results in betterutilisation of the system resources compared to randomrouting, judging by the number of requests that remain in thequeues at the dyno level.

Smart routing results in a significantly shorter average queuelength, regardless of the workload.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 88: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Comments on the results

Here, the system usage is similar for both random and smartrouting.

For the smart system, the dyno queues have significantlyshorter length when compared to the random routing policy,implying that the requests wait less time for service.

To summarise, the smart routing policy results in betterutilisation of the system resources compared to randomrouting, judging by the number of requests that remain in thequeues at the dyno level.

Smart routing results in a significantly shorter average queuelength, regardless of the workload.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 89: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Experimentation with the system size

The previous results show that in a medium-sized systemthere is a significant difference in terms of performancebetween the two routing policies considered.

We now investigate how many dynos are required to service9000 requests per minute, translated into a request arrivalrate of 150 per second which is the reported workload for RapGenius.

In this experiment, we consider a fixed arrival rate equal to150, and experiment with the size of the system to determinehow many dynos have to be leased, to minimise both thenumber of idle dynos and the queue length at the dynos.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 90: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Random20:20 and Smart20:20 results for rrequest = 150

140 Chapter 6. Case Study on Cloud Computing

value of choice in Section 5.3.

Figure 6.8 outlines the transient behaviour for 20 web dynos and 20 worker dynos.

Each sub-figure describes how the average population of idle dynos and the average

queue lengths at the dyno-level change through time. More specifically, in Figure

6.8(d) we see that we have only a small number of idle dynos, while the number of

jobs queued at the dyno-level remains small. Therefore, the system of this size has

been found to be adequate to service 9000 requests per minute by using the smart

routing policy. According to Figure 6.8(c) however, the queue lengths are considerably

larger for the random policy. Simply, more dynos are needed to decrease the number

of requests waiting in the dyno queues.

0

5

10

15

20

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(a) Random routing (Direct Method)

0

5

10

15

20

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(b) Smart routing (Direct Method)

0

5

10

15

20

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(c) Random routing (Trajectory Sampling)

0

5

10

15

20

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(d) Smart routing (Trajectory Sampling)

Figure 6.8: Random20:20 and Smart20:20 results for rrequest = 150 (105 simulation runs)

We have also considered a system with 60 web dynos and 60 worker dynos, whose

results are summarised in Figure 6.9. For the random routing policy in Figure 6.9(c),

we have relatively small but non-zero number of requests in the dyno queues. It ap-

pears that a random routing policy has a negative impact on the request waiting time,

(a) Random routing (b) Smart routing

In (b) the number of idle dynos is small, while the number of jobsqueued at the dyno-level is acceptably small. However, in (a) thequeue lengths are considerably larger.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 91: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

More experimentation with the system size

We also considered a system with 60 web dynos and 60worker dynos.

For the random routing policy we have a relatively small butnon-zero number of requests in the dyno queues. It appearsthat a random routing policy has a negative impact on therequest waiting time, regardless of the size of the system.

For the smart routing policy there almost no requests waiting.But note that, in both cases, a large part of the systemremains idle, meaning that the use of 60 dynos of each kind isa waste of resources considering the given workload.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 92: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Random60:60 and Smart60:60 results for rrequest = 150

6.3. Evaluation of Routing Policies 141

regardless of the size of the system. The picture is quite different for the smart policy

in Figure 6.9(d), where the almost no request is waiting. In both cases though, a large

part of the system remains idle, meaning that the use of 60 dynos of each kind is simply

a waste of resources considering the given workload.

Apparently, a system of 20 web and 20 worker dynos featuring a smart routing

policy should be enough to service the typical workload of a website such as Rap

Genius. Replacing smart with a random policy will only increase the number of dynos

required to service the same workload at the same rate, and therefore diminish the

quality of service provided to the clients.

0

10

20

30

40

50

60

70

80

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(a) Random routing (Direct Method)

0

10

20

30

40

50

60

70

80

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

nTime (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(b) Smart routing (Direct Method)

0

10

20

30

40

50

60

70

80

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(c) Random routing (Trajectory Sampling)

0

10

20

30

40

50

60

70

80

0 0.5 1 1.5 2 2.5 3 3.5 4

Po

pu

latio

n

Time (sec)

Web dynos idleWorker dynos idle

Web queueWorker queueRouter queue

(d) Smart routing (Trajectory Sampling)

Figure 6.9: Random60:60 and Smart60:60 results for rrequest = 150 (105 simulation runs)

Regarding the approximation quality of our trajectory sampling algorithm, its re-

sults are practically identical to the output of the direct method. In fact, this outcome

was anticipated, as it is compliant with the conclusions of Chapter 5. We have char-

acterised trajectory sampling simulation as an almost exact method, in the sense that

it can be arbitrarily precise. We have seen experimentally observed in Section 5.3 that

(a) Random routing (b) Smart routing

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku

Page 93: Performance Modelling Lecture 12: PEPA Case Study: Rap ... · Performance Modelling | Lecture 12: PEPA Case Study: Rap Genius on Heroku. PEPA Case StudyRap GeniusModelling Heroku

PEPA Case Study Rap Genius Modelling Heroku Routing with PEPA Evaluation of Routing Policies

Summary

The example used has been motivated by a particular incidentinvolving the Rap Genius website, where a change in therouting policy has been reported to negatively affect thequality of service experienced by clients.

Our model does not aspire to be an accurate representation ofRap Genius/Heroku. Nevertheless it provides a realisticrepresentation of a system of that scale.

Our experimentation shows that a smart routing policy resultsin a significantly smaller number of requests waiting to beserviced, compared to a random policy.

Jane Hillston & Dimitrios Milios School of Informatics The University of Edinburgh Scotland

Performance Modelling — Lecture 12: PEPA Case Study: Rap Genius on Heroku


Recommended