Skip to content

[KV] Add Configuration Option to Control RocksDB Statistics Collection #2435

@platinumhamburg

Description

@platinumhamburg

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

RocksDB statistics collection has performance overhead. Users should be able to disable it when:

  • RocksDB-level metrics are not needed
  • Running in resource-constrained environments
  • Troubleshooting performance issues

Solution

New Configuration

Option Type Default Description
kv.rocksdb.statistics.enabled Boolean false Enable RocksDB statistics collection for metrics

Files Modified

  • ConfigOptions.java - Add new config option
  • KvTablet.java - Read config to control statistics initialization
  • RocksDBStatistics.java - Minor optimization: use getLongProperty() instead of getProperty() to reduce JNI memory overhead
  • configuration.md - Documentation

Anything else?

Additional Optimization:

Replaced RocksDB.getProperty() with getLongProperty() in statistics collection to avoid unnecessary string allocation in JNI layer during high-frequency Prometheus scraping.

Willingness to contribute

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions