Rabbit is a database tool for knob tuning with RAG.
To set up the environment for Rabbit, follow these steps:
-
Create a conda virtual environment named
Rabbit:conda create -n Rabbit python=3.10
-
Activate the virtual environment:
conda activate Rabbit
-
Install the required dependencies using
requirements.txt:pip install -r requirements.txt
-
Make a copy of the example environment variables file and modify the OPENAI_API_KEY, PROXY, LLM_MODEL:
cp .env.template .env
-
Add your API key to the newly created .env file.
Now, you have successfully set up the environment for Rabbit. You can proceed with using the tool for knob tuning with RAG.
-
Install
PostgreSQLandMySQL -
Install BenchBase with our
scripts/cd ./scripts sh install_benchbase.sh mysql -
Set up specific benchmark (e.g., TPC-C).
Note: modify ./benchbase/target/benchbase-mysql/config/mysql/sample_{your_target_benchmark}_config.xml to customize your tuning setting first
sh build_benchmark.sh mysql tpcc-
modify configs/mysql.ini to determine the target DBMS first, the restart and recover commands depend on the environment
-
Structure the document information into a diagram and generate a knob knowledge graph
Note: The input document needs to be placed in ./knowledge/mysql/graph/input/ Modify ./knowledge/mysql/graph/settings.yaml for your enviroment and run:
sh build_graph.shThe graph knowledge will output in ./knowledge/mysql/graph/output/.
-
Run Rabbit like this:
python run.py
-
Observe the output of the command line, and its results will exist in the
optimization_results/folder.