introduction to benchmark - github pages · •general steps • generate parameters from...
TRANSCRIPT
![Page 1: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/1.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/2.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/3.jpg)
• 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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/4.jpg)
• 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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/5.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/6.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/7.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/8.jpg)
• 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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/9.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/10.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/11.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/12.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/13.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/14.jpg)
14
![Page 15: Introduction to Benchmark - GitHub Pages · •General steps • Generate parameters from TxParamGenerator • Store Procedure • callStoredProc(…) to execute a stored procedure](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/15.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/16.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/17.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/18.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/19.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/20.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/21.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/22.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/23.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/24.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/25.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/26.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/27.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/28.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/29.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/30.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022052220/5f1bf7c60f5d5f748c1bdfbd/html5/thumbnails/31.jpg)
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