introduction to benchmark - github pages · •general steps • generate parameters from...

31
Introduction to Benchmark Database Systems DataLab, CS, NTHU Spring, 2020 1

Upload: others

Post on 04-Jul-2020

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Introduction to Benchmark

Database SystemsDataLab, CS, NTHU

Spring, 2020

1

Page 2: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

JDBC / SP ?

JDBC SP

Query Parameter

Page 3: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

• VanillaBench Project

• Introduction to VanillaBench

• Starting Up Server for Benchmarking

• Setting Benchmark Configurations

• Running Benchmark Client

• VanillaBench

3

Outline

Page 4: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

• VanillaBench Project

• Introduction to VanillaBench

• Starting Up Server for Benchmarking

• Setting Benchmark Configurations

• Running Benchmark Client

• VanillaBench

4

Outline

Page 5: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

VanillaBench

• VanillaBench is a project designed for automatically benchmarking VanillaCore

• It contains several benchmark procedures• It also has a lot of adjustable testing parameters

5[Icon Source]

Page 6: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

JDBC / SP ?

JDBC SP

Query Parameter

Page 7: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Two Main Methods

7

BENCHMARKSERVER-StartUp

BENCHMARKCLIENT-App

Page 8: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

• VanillaBench Project

• Introduction to VanillaBench

• Starting Up Server for Benchmarking

• Setting Benchmark Configurations

• Running Benchmark Client

• VanillaBench

8

Outline

Page 9: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Clone the Project First

• The code of VanillaBench has been pushed to vanilladb repository

• All you need is to clone from the remote repository

• You can clone from here:

• https://shwu10.cs.nthu.edu.tw/courses/databases/2020-spring/db20-assignment-2

9

> git clone

Page 10: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Starting Up Server (1/2)• To benchmark a VanillaDB server, you need to start up

the server in another entry point

10

Page 11: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Starting Up Server (2/2)• You also need to add one more VM argument for

benchmarking.

• Don’t forget to add the Database Directory Name

11

You can copy those arguments from here

Page 12: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Server Messages

12

You should see similar messages if there is nothing wrong.

Page 13: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Setting Benchmark

• Benchmark project also has its own set of properties files

13

Page 14: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

14

Page 15: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Important Parameters

• CONNECTION_MODE

• It means whether it should use JDBC or stored procedures

15

Page 16: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Running Client• To run clients, create a run configuration for it

16

Page 17: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Arguments• We also need to set some arguments

• Program Arguments

• [Action]

• 1 : Load Test-Bed

• 2 : Lunch Benchmark

• VM Arguments

• Use the same as the server

17

Page 18: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

18

You can copy those arguments from here,then click ‘Apply’ and ‘Run’

Page 19: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Notes

• Before running testing, please load testbed first

• Check if the output directory path that show in properties file exists

• If not, create one or change the path

19

Page 20: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

JDBC / SP ?

JDBC SP

Query Parameter

CheckDatabaseJdbcJob

TestbedLoaderJdbcJob

ReadItemTxnJdbcJob

TestbedLoaderProc

CheckDatabaseProc

ReadItemTxnProc

Page 21: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Two Main Methods

21

BENCHMARKSERVER-StartUp

BENCHMARKCLIENT-App

Page 22: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

The Workflow of A Client

App

loadTestbed() benchmark()

Create

Load Testbed Start Benchmarking

Depends on the Argument

22

org.vanilladb.bench.VanillaBench

Page 23: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Loading Testbed

loadTestbed()

Connect to server and execute:

TestbedLoader

23

Page 24: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Starting Benchmark

benchmark()

Create

RTEs

Remote Terminal Emulator

Emulates a remote terminal, executing a sequence of transactions

24

Page 25: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Server & Client

25

BENCHMARKSERVER

RTE

RTE RTE

Page 26: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

RTE’s Life Cycle

run()

stopBenchmark()

end

executeTxCycle()

26

org.vanilladb.bench.rte.RemoteTerminalEmulator

Page 27: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Executing a TxexecuteTxCycle()

getTxExecutor(type)

executor

executor.execute() start to record execution time

executeTxn()

getJdbcExecutor().execute(…) callStoredProc(…)

Depends on JDBC / SP

27

RTE

TransactionExecutor

Page 28: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

JDBC / SP ?

JDBC SP

Query * 5 Parameter * 1

Page 29: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Workflow of Executing a Tx• General steps

• Generate parameters from TxParamGenerator

• Store Procedure

• callStoredProc(…) to execute a stored procedure on the remote server, with the generated parameters

• Remote server will return a SutResultSet when the procedure is finished

• JDBC

• getJdbcExecutor().execute(…) to execute a JDBC Job in the local, with the generated parameters

• Job will executing each sql via JDBC connector

29

Page 30: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

How Server Process a StoredProc call ?

• When the server receive a remote procedure call, it will ask StoredProcFactory to generate the appropriate StoredProcedure

• The server will then call the StoredProcedure methods:

• prepare(Obj…)

• preparing the parameters

• execute()

• executing the transaction

• this method will return the final result to the client

30

Page 31: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure

Q&A

• If you got any problem, you could check here first

• https://shwu10.cs.nthu.edu.tw/courses/databases/2020-spring/faq

• If your problem was very unique, just send us an email

31