Skip to content

swordcs/EAST

Repository files navigation

EAST: An Transferable Knob Estimation System for Cloud Database

Our system supports the direct knob estimation service and transferable knob estimation service. Overview

Table of contents

  1. Main Modules
  2. Setup
  3. Benchmark
  4. Run
  5. Experiment

Main Modules

Module Description
knob_tool Knob management tools, including database restart, configuration update, etc.
knob_evaluator Model implementation and historical experience reuse.
collect Collect performance data.
rank Sort by Knob Importance data.
main Task startup and parameter parsing.

Setup

Set up a virtual environment and install according dependencies.

conda create -n venv python=3.8
conda activate venv
pip install -r ./requirements.txt

During the experimental phase, we deploy databases using Docker containers and you need to fill in the necessary information in config.yaml before start it.

example:

sudo -S docker run --name pg_test --privileged=true -m 4G --cpus 4 --device-write-bps /dev/sda:50MB --device-read-bps /dev/sda:50MB -d -e POSTGRES_PASSWORD=Secretpassword@123 -v /data/postgresql/pg_test:/var/lib/postgresql/data -u root -p 5432:5432 postgres

Benchmark

We use the open-source database benchmarking tool benchbase for database performance testing and data collection.

You need to download the repo and compile benchbase, then add the tool path into config.yaml

Run

usage: An Efficient Estimation System for the Knob Tuning under Dynamic Workload [-h] [--config [CONFIG]] [--collect] [--two_stage] [--rank] [--evaluate] [--train] [--save]

optional arguments:
  -h, --help            show this help message and exit
  --config [CONFIG], -c [CONFIG]
                        config file used to connect database and execute workload
  --collect             execute collect command
  --two_stage           collect performance data using two-stage strategy
  --rank                execute rank command
  --evaluate            evaluate knob performance for given config
  --train               train model for knob performance evaluation
  --save                save current experience into pool

Nice:)

An example for direct learning, containing the data collection, knob importance ranking and model training.

python ./__main__.py --config dbmind/components/knob_estimator/share/config.yaml --collect
python ./__main__.py --config dbmind/components/knob_estimator/share/config.yaml --rank
python ./__main__.py --config dbmind/components/knob_estimator/share/config.yaml --train

Also, EAST could implement the transfer learning to obtain the knob estimator from historical experiences. First remove the model_path in config.yaml and run the following command, the program will automatically reuse the history experience, and obtain the tuning recommendation from EAST.

python ./__main__.py --config dbmind/components/knob_estimator/share/config.yaml --evaluate

Experiment

We show some preliminary evaluations for knob transfer estimation in YCSB and TPCC. More experiment result could be found in Research Paper.

YCSB

YCSB Result

TPCC

TPCC Result

About

Efficient knob estimator for database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors