Rubik Configuration Description
Basic Configuration Description
The Rubik program is written in Go and compiled into a static executable file to minimize the coupling with the system.
Besides the -v
option for querying version information, Rubik does not support other options. The following is an example of version query output:
rubik -v
Version: 1.0.0
Release: 5
Go Version: go1.17.3
Git Commit: 8e373d2
Built: 2022-12-12
OS/Arch: linux/amd64
Rubik parses configuration file /var/lib/rubik/config.json
upon process startup. Custom configuration file path is currently not supported to avoid confusion.
The configuration file is in JSON format and keys are in lower camel case.
An example configuration file is as follows:
{
"autoCheck": false,
"logDriver": "stdio",
"logDir": "/var/log/rubik",
"logSize": 1024,
"logLevel": "info",
"cgroupRoot": "/sys/fs/cgroup",
"cacheConfig": {
"enable": false,
"defaultLimitMode": "static",
"adjustInterval": 1000,
"perfDuration": 1000,
"l3Percent": {
"low": 20,
"mid": 30,
"high": 50
},
"memBandPercent": {
"low": 10,
"mid": 30,
"high": 50
}
},
"blkioConfig": {
"enable": false
},
"memoryConfig": {
"enable": true,
"strategy": "none",
"checkInterval": 5
}
}
Common configuration items:
key[=default_value] | Type | Description | Example Value |
---|---|---|---|
autoCheck=false | bool | Whether to automatically rectify incorrect configurations caused by errors. | false, true |
logDriver=stdio | string | Log driver, which can be the standard I/O or file. | stdio, file |
logDir=/var/log/rubik | string | Log directory | /var/log/rubik |
logSize=1024 | int | Total size of logs in MB when logDriver=file | [10, 2**20] |
logLevel=info | string | Log level | debug, info, error |
cgroupRoot=/sys/fs/cgroup | string | Mount point of the system cgroup | /sys/fs/cgroup |
cacheConfig | map | Configurations of the CPU cache dynamic control module (dynCache) | Non |
.enable=false | bool | Whether to enable dynCache | false, true |
.defaultLimitMode=static | string | dynCache control mode | static, dynamic |
.adjustInterval=1000 | int | Interval for dynCache control, in milliseconds | [10, 10000] |
.perfDuration=1000 | int | perf execution duration for dynCache, in milliseconds | [10, 10000] |
.l3Percent | map | Watermarks of each L3 cache level of dynCache in % | Non |
..low=20 | int | Watermark of the low L3 cache level | [10, 100] |
..mid=30 | int | Watermark of the middle L3 cache level | [low, 100] |
..high=50 | int | Watermark of the high L3 cache level | [mid, 100] |
.memBandPercent | map | Watermarks of each memory bandwidth level of dynCache in % | Non |
..low=10 | int | Watermark of the low bandwidth level | [10, 100] |
..mid=30 | int | Watermark of the middle bandwidth level | [low, 100] |
..high=50 | int | Watermark of the high bandwidth level | [mid, 100] |
blkioConfig | map | Configurations of the I/O control module | Non |
.enable=false | bool | Whether to enable the I/O control module | false, true |
memoryConfig | map | Configurations of the memory control module | Non |
.enable=false | bool | Whether to enable the memory control module | false, true |
.strategy=none | string | Dynamic reclamation strategy for memory of different levels | none, dynlevel, fssr |
.checkInterval=5 | string | Dynamic reclamation strategy check interval | (0, 30] |