31
Technische Universit¨ at M¨ unchen & HP Labs Adaptive Query Scheduling for Mixed Database Workloads with Multiple Objectives Stefan Krompass TUM , Harumi Kuno HPL , Kevin Wilkinson HPL ,Umeshwar Dayal HPL , Alfons Kemper TUM TUM Technische Universit¨ at M¨ unchen Munich, Germany HPL Hewlett-Packard Laboratories Palo Alto, CA, USA

Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Embed Size (px)

Citation preview

Page 1: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Adaptive Query Scheduling for Mixed Database

Workloads with Multiple Objectives

Stefan KrompassTUM, Harumi KunoHPL,

Kevin WilkinsonHPL,Umeshwar DayalHPL, Alfons KemperTUM

TUMTechnische Universitat Munchen

Munich, Germany

HPLHewlett-Packard Laboratories

Palo Alto, CA, USA

Page 2: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Problem statement

• n service classes (i. e., a set of queries)

• n ·m objectives (multiple objectives per service class)

• n · k control knobs (to control service per class, e. g., MPL)

Search problem

Find control knobs settings to achieve objectives for all service classes

Page 3: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Problem statement

• n service classes (i. e., a set of queries)

• n ·m objectives (multiple objectives per service class)

• n · k control knobs (to control service per class, e. g., MPL)

Search problem

Find control knobs settings to achieve objectives for all service classes

Page 4: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Difficulties

• Large search space

• Queries have different characteristics (resource requirements,

variance in resource requirements)

• Service classes have different characteristics (start time, arrival

rate, objectives)

• Contention among the queries unknown

• Non-linear relationships between objectives and the control

parameters

Page 5: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Difficulties

• Large search space

• Queries have different characteristics (resource requirements,

variance in resource requirements)

• Service classes have different characteristics (start time, arrival

rate, objectives)

• Contention among the queries unknown

• Non-linear relationships between objectives and the control

parameters

In this presentation:Present framework

and experiments withalgorithm to tacklethe search problem

Page 6: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Solution approach

• Base: algorithm devised by Niu et. al: “Adapting Mixed Workloads

to Meet SLOs in Autonomic DBMSs”

⇒ Multi-class, single objective

• Extension: assume relationship between objectives is known in

order to solve our problem

Page 7: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Workload Adaptation-Maximize Single Objective

• Goal: maximize overall utility (measure to quantify how well the

system meets the objectives)

• Service classes s1, . . . , sn, each with single objective

• Idea: assign system resources to service classes by controlling the

number of queries a service class may run

• Service class si has control knob xi

• Assumption: ∃“system cost limit” X where performance is

maximized

Page 8: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Workload Adaptation-Maximize Single Objective

maximizex1,...,xn

u1

(

h1 (x1))

+ · · · + un

(

hn (xn))

subject to x1 + · · ·+ xn = X

• Estimation model: control knob setting (xi) → estimated

performance

• Utility function: performance value → utility (positive if

performance > objective, negative otherwise; utility decrease faster

for lower performance, utility increase slower with better

performance)

Page 9: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Dominance

Definition

Objective o is dominant for a service class if a set of conditions

satisfying o implies that the other objectives of this service class are

satisfied as well.

Note

• Dominance holds only for a specified range of control knob settings

• Dominance applies to objectives of a single service class only

Example

If average response time requirement is satisfied, throughput is also

Page 10: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Framework

Workload objectives

Workload

Queries

Service level

objectives

Queries

Service level

objectives

Queries

Service level

objectives

Workload manager

Admission controller

Scheduler

Execution controller

Policy controller

DBMS

Policy control loop

Page 11: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Framework

Workload objectives

Workload

Queries

Service level

objectives

Queries

Service level

objectives

Queries

Service level

objectives

Workload manager

Admission controller

Scheduler

Execution controller

Policy controller

Simulated DBMS

Policy control loop

Page 12: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Why a simulator?

• Deterministic

• Repeatable results

• Experiment with varying workloads with varying characteristics

• Easily change system configuration

• Speedup

Page 13: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

ExperimentsPurpose of the experiments

• Two service classes, each with throughput and average response

time objectives

• Control knobs: vary MPL for each service class

• Goal: find MPL settings where each objective is met

Page 14: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

ExperimentsExperimental setup

• Database engine models a parallel, shared-nothing architecture;

four nodes with eight disks

• Data is partitioned across the disks

• More details on simulated engine in the paper

• Multiple streams per service class, each stream sends queries one

after the other with no wait time between two queries

• OLTP-style queries; a query accesses data on a single partition only

Page 15: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Experiment 1

Service class 1 Service class 2

Average response time (sec) 0.25 1.0

Throughput (q/sec) 130 80

Dominant objective throughput throughput

Algorithm optimizes for throughput throughput

Page 16: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsoverall search space

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

Page 17: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsoverall search space

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

Objectives of

class 1 met,

objectives of

class 2 violatedObjectives of

class 2 met,

objectives of

class 1 violated

Objectives

of classes 1

and 2 met

Page 18: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultssearch space considered by workload adaptation-MSO

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

search space considered by

workload adaptation-MSO

Page 19: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsworkload adaptation-MSO

0

5

10

15

20

25

0 200 400 600 800 1000

MP

L

Time

MPL1MPL2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Th

rou

gh

pu

t(in

qu

erie

s p

er

se

co

nd

)

Time (in seconds)

s1s2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Th

rou

gh

pu

t(in

qu

erie

s p

er

se

co

nd

)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg

re

sp

on

se

tim

e(in

se

co

nd

s)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg

re

sp

on

se

tim

e(in

se

co

nd

s)

Time (in seconds)

s1s2

0

5

10

15

20

25

0 200 400 600 800 1000

MP

L

Time

MPL1MPL2

20

12

Page 20: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsworkload adaptation-MSO

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

Page 21: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Experiment 2

Service class 1 Service class 2

Average response time (sec) 0.25 0.6

Throughput (q/sec) 100 80

Dominant objective average response time throughput

Algorithm optimizes for throughput throughput

Page 22: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsnaıve

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

Page 23: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultssearch space considered by workload adaptation-MSO

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

Page 24: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultssearch space considered by workload adaptation-MSO

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

Cannot find setting

in operating envelope

with MPL sum = 32

⇒ increase to 48

Page 25: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultssearch space considered by workload adaptation-MSO

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

Page 26: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsworkload adaptation-MSO

0

5

10

15

20

25

30

35

0 200 400 600 800 1000

MP

L

Time

MPL1MPL2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Th

rou

gh

pu

t(in

qu

erie

s p

er

se

co

nd

)

Time (in seconds)

s1s2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Th

rou

gh

pu

t(in

qu

erie

s p

er

se

co

nd

)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg

re

sp

on

se

tim

e(in

se

co

nd

s)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg

re

sp

on

se

tim

e(in

se

co

nd

s)

Time (in seconds)

s1s2

0

5

10

15

20

25

30

35

0 200 400 600 800 1000

MP

L

Time

MPL1MPL2

30

18

Page 27: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsworkload adaptation-MSO

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

Page 28: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsworkload adaptation-MSO

MPL service class 1

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32

MPLserviceclass

2

2

4

6

8

10

12

14

16

18

20

22

24

26

28

30

32

Solution exists in

the search space

but algorithm

does NOT find it

Page 29: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsworkload adaptation-MSO

0

5

10

15

20

25

30

35

0 200 400 600 800 1000

MP

L

Time

MPL1MPL2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Th

rou

gh

pu

t(in

qu

erie

s p

er

se

co

nd

)

Time (in seconds)

s1s2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Th

rou

gh

pu

t(in

qu

erie

s p

er

se

co

nd

)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg

re

sp

on

se

tim

e(in

se

co

nd

s)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg

re

sp

on

se

tim

e(in

se

co

nd

s)

Time (in seconds)

s1s2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Thro

ughput

(in q

ueries p

er

second)

Time (in seconds)

s1s2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Thro

ughput

(in q

ueries p

er

second)

Time (in seconds)

s1s2

throughput okay

Page 30: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Resultsworkload adaptation-MSO

0

5

10

15

20

25

30

35

0 200 400 600 800 1000

MP

L

Time

MPL1MPL2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Th

rou

gh

pu

t(in

qu

erie

s p

er

se

co

nd

)

Time (in seconds)

s1s2

0

20

40

60

80

100

120

140

160

0 200 400 600 800 1000

Th

rou

gh

pu

t(in

qu

erie

s p

er

se

co

nd

)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg

re

sp

on

se

tim

e(in

se

co

nd

s)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg

re

sp

on

se

tim

e(in

se

co

nd

s)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg r

esponse tim

e(in s

econds)

Time (in seconds)

s1s2

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

0 200 400 600 800 1000

Avg r

esponse tim

e(in s

econds)

Time (in seconds)

s1s2

average response

time of service

class s2 violated

Page 31: Adaptive Query Scheduling for Mixed Database Workloads ...db.in.tum.de/research/publications/conferences/DBTest-2010-WoMa-presentation.pdfTechnische Universitat Mu¨nchen & HP Labs

Technische Universitat Munchen & HP Labs

Conclusion and ongoing work

• Presentation of test framework

• Comprehensive search solves the search problem, and gives

additional information: Does a solution exist? How many settings

satisfy the constraints? → prohibitively expensive

⇒ Need heuristic approach

• Solutions found by workload adaptation-MSOare “fragile”

⇒ Need different set of algorithms to solve the search problem