Towards a General Framework for ML-based Self-tuning Databases

Thomas Schmied, Diego Didona, Andreas C. Döring, Thomas P. Parnell, Nikolas Ioannou

TL;DR

While complex Machine Learning (ML) models like Bayesian Optimization and Reinforcement Learning can boost database throughput by up to 38%, simple random search performs nearly as well—trailing by only 4%. This paper highlights that the real hurdle in autonomous database tuning isn't the "intelligence" of the model, but the practical challenge of navigating high-dimensional spaces filled with "invalid" configurations that can crash a system.

What Problem Does This Paper Address?

Modern databases like FoundationDB, MySQL, and PostgreSQL expose hundreds of configuration parameters (knobs). Manually tuning these for peak performance is a nightmare for administrators. While researchers have proposed using ML to automate this, most existing studies assume a "clean" environment where parameter ranges are already known and every configuration is safe to run.

In reality, applying ML to a new database presents two major roadblocks:

  1. The "Invalid Configuration" Trap: Many combinations of parameters result in a database that won't start or becomes unresponsive.
  2. High Dimensionality: With over 350 parameters in FoundationDB, the search space is too vast for standard ML models to explore efficiently without crashing the system repeatedly.

The authors aim to create a more general framework that requires minimal domain expertise to tune a database from scratch.

Methods

The authors evaluate two state-of-the-art ML approaches and compare them against a randomized baseline:

  • Bayesian Optimization (BO): Uses a Gaussian Process surrogate model to predict performance and an "acquisition function" to decide which configuration to try next (balancing exploration and exploitation).
  • Reinforcement Learning (RL): Based on the CDBTune system, using a Deep Deterministic Policy Gradient (DDPG) agent that learns to adjust knobs to maximize a "reward" (throughput improvement).
  • Random Search: A simple baseline that picks configurations at random.

To make these work, they introduced several novel sampling techniques:

  • Symmetric Latin Hypercube Sampling (LHS): Standard sampling often biases toward high values when ranges are large. Symmetric LHS ensures that values both much smaller and much larger than the default are sampled with equal frequency.
  • Random Sub-sampling: Instead of changing all 350+ parameters at once (which almost guarantees a crash), they only modify a random subset of parameters, significantly increasing the percentage of "valid" runs.
  • Feature Selection: They used a Random Forest regressor to identify the 10 most impactful parameters out of 350+, focusing the ML models only on what matters.

Datasets

The study uses FoundationDB (v6.2.20) as the primary testbed.

  • Workload: A synthetic benchmark consisting of 1 million key-value pairs (16-byte keys, 512-byte values).
  • Traffic: A 60:40 read:write mix generated by two client machines against a three-server cluster.
  • Parameters: 350+ tuning knobs extracted programmatically from the FoundationDB source code.

Key Insights and Ideas

  • The "Random" Reality Check: The most striking insight is that Random Search is a "highly competitive baseline." In many ML papers, simple baselines are omitted, making complex models look more revolutionary than they might be.
  • Range Matters: Defining the "valid range" for a parameter is a hidden form of domain knowledge. If you set the range too wide, the ML model spends all its time in "invalid" states; too narrow, and you miss out on performance gains.
  • Symmetry in Sampling: When parameters span orders of magnitude (e.g., timeouts), linear sampling is inefficient. Sampling symmetrically around the default value is crucial for discovering performance gains in low-value settings.
  • Database Design for Tuning: The authors argue that databases should be built with "self-tuning in mind," perhaps by including metadata that defines valid ranges and dependencies between parameters to prevent invalid configurations by design.

Key Results

  • Performance Boost: Both BO and RL successfully improved FoundationDB's throughput by approximately 38% compared to the default configuration.
  • The Gap: Random search achieved a 34% improvement. This means the "vastly more complex" ML methods only provided a 4% marginal gain over picking points at random.
  • Statistical Significance: Using a t-test, the authors found no statistically significant difference between the configurations found by Random Search and those found by BO or RL.
  • Efficiency: Through feature selection, they found that just 10 parameters (out of 350) accounted for 90% of the performance impact.

Limitations and Future Work

  • Search Steps: The experiments were limited to 200 steps. It is possible that with thousands of steps, the ML models might eventually diverge more significantly from random search.
  • Single Workload: The results are based on one specific read/write mix. Performance dynamics might change under more complex or shifting workloads.
  • Model-Free Focus: The authors suggest that future research should move away from complex "black-box" ML models and toward more robust, randomized, model-free algorithms like Successive Halving or Hyperband, which are better suited for the messy reality of database configurations.

Summary updated

BibTeX
@inproceedings{schmied2021towards,
  author = {Thomas Schmied and Diego Didona and Andreas C. Döring and Thomas P. Parnell and Nikolas Ioannou},
  title = {{Towards a General Framework for ML-based Self-tuning Databases}},
  booktitle = {EuroMLSys@EuroSys},
  year = {2021},
  url = {https://openreview.net/forum?id=RNY18NnX_v},
}

Loading related content...

Figure