Skip to main content

Rocksdb Tuning Advisor

Motivation

The performance of Rocksdb is contingent on its tuning. However, because of the complexity of its underlying technology and a large number of configurable parameters, a good configuration is sometimes hard to obtain. The aim of the python command-line tool, Rocksdb Advisor, is to automate the process of suggesting improvements in the configuration based on advice from Rocksdb experts.

Overview

Experts share their wisdom as rules comprising of conditions and suggestions in the INI format (refer rules.ini). Users provide the Rocksdb configuration that they want to improve upon (as the familiar Rocksdb OPTIONS file — example) and the path of the file which contains Rocksdb logs and statistics. The Advisor creates appropriate DataSource objects (for Rocksdb logs, options, statistics etc.) and provides them to the Rules Engine. The Rules uses rules from experts to parse data-sources and trigger appropriate rules. The Advisor's output gives information about which rules were triggered, why they were triggered and what each of them suggests. Each suggestion provided by a triggered rule advises some action on a Rocksdb configuration option, for example, increase CFOptions.write_buffer_size, set bloom_bits to 2 etc.

Usage

Prerequisites

The tool needs the following to run:

  • python3

Running the tool

An example command to run the tool:

cd rocksdb/tools/advisor
python3 -m advisor.rule_parser_example --rules_spec=advisor/rules.ini --rocksdb_options=test/input_files/OPTIONS-000005 --log_files_path_prefix=test/input_files/LOG-0 --stats_dump_period_sec=20

Command-line arguments

Most important amongst all the input that the Advisor needs, are the rules spec and starting Rocksdb configuration. The configuration is provided as the familiar Rocksdb Options file (refer example). The Rules spec is written in the INI format (more details in rules.ini).

In brief, a Rule is made of conditions and is triggered when all its constituent conditions are triggered. When triggered, a Rule suggests changes (increase/decrease/set to a suggested value) to certain Rocksdb options that aim to improve Rocksdb performance. Every Condition has a 'source' i.e. the data source that would be checked for triggering that condition. For example, a log Condition (with 'source=LOG') is triggered if a particular 'regex' is found in the Rocksdb LOG files. As of now the Rules Engine supports 3 types of Conditions (and consequently data-sources): LOG, OPTIONS, TIME_SERIES. The TIME_SERIES data can be sourced from the Rocksdb statistics or perf context.

For more information about the remaining command-line arguments, run:

cd rocksdb/tools/advisor
python3 -m advisor.rule_parser_example --help

Sample output

Here, a Rocksdb log-based rule has been triggered:

Rule: stall-too-many-memtables
LogCondition: stall-too-many-memtables regex: Stopping writes because we have \d+ immutable memtables \(waiting for flush\), max_write_buffer_number is set to \d+
Suggestion: inc-bg-flush option : DBOptions.max_background_flushes action : increase suggested_values : ['2']
Suggestion: inc-write-buffer option : CFOptions.max_write_buffer_number action : increase
scope: col_fam:
{'default'}

Running the tests

Tests for the code have been added to the test/ directory. For example, to run the unit tests for db_log_parser.py:

cd rocksdb/tools/advisor
python3 -m unittest -v test.test_db_log_parser

Metadata

Release files for Adviser-Rocksdb 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Adviser-Rocksdb 0.0.1
File Size Uploaded Provenance
Adviser-Rocksdb-0.0.1.tar.gz 31.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for Adviser-Rocksdb 0.0.1
File Interpreter ABI Platform
Adviser_Rocksdb-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 72.3 kB

Release files / Adviser-Rocksdb-0.0.1.tar.gz

Download URL Adviser-Rocksdb-0.0.1.tar.gz
Size 31.3 kB
Tags Source
SHA-256 checksum
How to use checksums
20c543ac1def9a9b03f82db72c0e5d949fc7942ee05dbfbbfba6991659e9f78b
BLAKE2b-256 checksum
How to use checksums
e8c0f5e964f91cbeb565a6f5ff234ba86fca2e0aef41689519ceea7f51ec9760
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

Release files / Adviser_Rocksdb-0.0.1-py3-none-any.whl

Download URL Adviser_Rocksdb-0.0.1-py3-none-any.whl
Size 41.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c328d5df56a48b3f2285fc27233a7834c82c9e5dd1418ecb449fa01d67b420de
BLAKE2b-256 checksum
How to use checksums
6aefcf55e88694180f063e698522c62c417a5638a41d728a1de0826fa592838d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

Security for Adviser-Rocksdb 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page