Skip to content

Health Check Configuration

Yaoxing edited this page Sep 1, 2025 · 4 revisions

Health Check Configuration

Most configurations has default and works out of the box. Unless you want to customize the tool, you can skip this section.

There is a build-in config.json so you don't need to write your own configuration.

You can pass your own configuration to the tool by specifying -c or --config.

This is a example of config file /config.json.

{
    "checksets":{
        "default": {
            "items": ["ClusterItem", "ServerStatusItem", "ShardKeyItem","HostInfoItem", "BuildInfoItem", "SecurityItem", "CollInfoItem", "IndexInfoItem"]
        }
    },
    "item_config": {
        "BuildInfoItem": {
            "eol_version": [4, 4, 0]
        },
        "CollInfoItem": {
            "obj_size_kb": 32,
            "collection_size_gb": 2048,
            "fragmentation_ratio": 0.5,
            "index_size_ratio": 0.2,
            "ops_latency_ms": 100
        },
        "IndexInfoItem": {
            "unused_index_days": 7,
            "num_indexes": 10
        },
        "ClusterItem": {
            "replication_lag_seconds": 0,
            "oplog_window_hours": 48
        },
        "ServerStatusItem": {
            "used_connection_ratio": 0.8,
            "query_targeting": 1000,
            "query_targeting_obj": 1000,
            "cache_read_into_mb": 100
        },
        "ShardKeyItem": {
            "sharding_imbalance_percentage": 0.1
        }
    },
    "template": "standard.html"
}

There's also the /config_test.json which sets the thresholds to a very low value. It will fail most tests and is mainly used for testing purpose.

1 Checksets

The checksets section in the above example.
Check sets allows you to define a group of check items that you want to run against the database. By default there's default checkset, which enables all check items. You can define new checksets that include different items. And you can choose which checkset to run by passing the -s or --checkset with the set name.

To define a checkset, add a new key in the checksets section:

  • checksets.<your set name>.items: Array of strings. The names of check items.

2 Item Config

The item_config section in the above example.
Each check item uses some thresholds to help determine whether a value is in the reasonable range. Some items don't need any thresholds like the SecurityItem. Exceeding any threshold will record a test fail item in the final report.

Item Name Value Meaning Default
BuildInfoItem eol_version Version older than this setting will be considered end of life. [4, 4, 0]
CollInfoItem obj_size_kb Largest object size in KB. 32
CollInfoItem collection_size_GB Largest collection size in GB. 2048
CollInfoItem fragmentation_ratio Highest storage fragmentation ratio. 0.5
CollInfoItem index_size_ratio Largest index:storage ratio. 0.2
CollInfoItem ops_latency_ms Highest operation latency in ms. 100
IndexInfoItem unused_index_days Longest unused days. 7
IndexInfoItem num_indexes Number of indexes on one collection. 10
ClusterItem replication_lag_seconds Replication lag in seconds. 0
ClusterItem oplog_window_hours Oplog window in hours. 48
ServerStatusItem used_connection_ratio Highest used:total connection ratio 0.8
ServerStatusItem query_targeting Scanned:Returned 1000
ServerStatusItem query_targeting_obj Scanned Object:Returned 1000
ServerStatusItem cache_read_into_mb Data read into cache / s 100

Clone this wiki locally