Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

Running the Tuner

Dana Van Aken edited this page Jan 23, 2018 · 6 revisions

The Automated Tuner Component

The Automated Tuner component is the only part of OtterTune's ML pipeline that is actively executed during a tuning session. New tuning sessions proceed as follows:

  1. The user specifies the target objective when creating the new tuning session (right now this always defaults to the throughput)

  2. The controller starts the first observation period, which is a period of time where it observes the application's workload while it is being executed/replayed. When the observation period ends, the controller collects the current knob configuration and internal runtime metrics from the DBMS and sends them to the server.

  3. The server stores the knob/metric data it receives from the controller in its repository and then uses its internal ML models to choose which DBMS knob configuration the user should run next. The next knob configuration is returned to the user.

  4. This process continues until the user is satisfied with the performance improvement achieved when running the workload with OtterTune's best configuration (so far) compared to the DBMS's initial knob configuration.

Implementation and Processing

The tasks in the Automatic Tuner component are implemented as asynchronous Celery tasks. That is, a new Celery task is scheduled to execute in the background whenever the user uploads new knob/metric data from the previous observation period. The user then must poll the webpage that displays information about the new data result to check on the Celery task's status. When the task finishes, the next DBMS knob configuration is ready for the user, and a link to download the next configuration will appear on the webpage.

Running the Tuner

This section discusses how to run the automated tuner. These directions assume that:

  1. You followed the Quick Setup with Vagrant steps and are currently SSH'd into the VM
  2. The website's database has been preloaded with the test_website fixture (see Getting Started)
  3. You are executing the commands from the website's root directory

Generate a single data sample

Create one knob/metric sample and upload it to the test user's tuning_session repository:

python script/controller_simulator/data_generator.py 1 1
python script/controller_simulator/upload_data.py script/controller_simulator/generated_data 0987654321

See Data Generation to learn how to generate/load data into the website.

Checking the status of the task

Follow the link to the user's tuning_session session. Then click on the Result ID (link) of the newest result provided in the Filtered Results table (this is probably the result with the highest ResultId). The overall status of the Celery tasks is listed in the Result Info table as Status. Following the link provided in the Status row displays the debug output for each Celery task that was executed.

Now follow the Status link to re the status of the Celery tasks. If the