Environment Stability Check Command stability-check
Command Function
Checks the environment stability to determine whether the environment load is stable based on the coefficient of variation (CV).
Syntax
1 | ./ksys stability-check [-h] [-d <sec>] [-i <sec>] [-o OUTPUT] [-l {0,1,2,3}] |
Parameter Description
Parameter |
Option |
Description |
|---|---|---|
-h/--help |
- |
Obtains help information. This parameter is optional. |
-d/--duration |
- |
Collection duration, in seconds. The value ranges from 10 to 120 seconds and defaults to 30 seconds. This parameter is optional. |
-i/--interval |
- |
Collection interval, in seconds. The minimum value and default value are both 1 second. This parameter is optional. |
-o/--output |
- |
Result file directory. This parameter is optional. If you do not set this parameter, a log file in the Y_M_D_H_M_S_stability format is generated in the current directory. |
-l/--log-level |
0/1/2/3 |
Log level, which defaults to 1. This parameter is optional.
|
Example
- Display the information about the stability-check command:
1./ksys stability-check -h
Command output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
USAGE ksys stability-check [-h] [-d <sec>] [-i <sec>] [-o OUTPUT] [-l {0,1,2,3}] DESCRIPTION Create a environment stability check command line task. options: -h, --help show this help message and exit -d <sec>, --duration <sec> Duration in seconds for the task collect. The minimum value is 10s. The maximum value is 120s. The default value is 30s. The user can use Ctrl+ \ to cancel the task or Ctrl+ C to stop the task. -i <sec>, --interval <sec> Interval in seconds for sampling. The minimum value is 1s, and the default value is 1s. The maximum value is recommand not to be greater than duration / 10 -o OUTPUT, --output OUTPUT Output the full path. -l {0,1,2,3}, --log-level {0,1,2,3} Set the log level (0=DEBUG, 1=INFO, 2=WARNING, 3=ERROR), which defaults to 1(INFO).
- Run the environment stability check command to check whether the current environment is stable.
./ksys stability-check -d 30 -i 1 -o /home/test/
Set the collection duration to 30 seconds and the collection interval to 1 second. Set the JSON file directory to /home/test/.
Command output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
[INFO] The coefficient of variation (CV) reflects the degree of data fluctuation. CV is defined as the ratio of the standard deviation σ to the mean μ, CV = σ / μ. A value greater than 0.15 is considered to have a certain degree of fluctuation. The larger the data, the greater the degree of fluctuation CPUFreq +--------+-------------+---------+---------+ | metric | current_mhz | min_mhz | max_mhz | +--------+-------------+---------+---------+ | cv | 0.0 | 0.0 | 0.0 | +--------+-------------+---------+---------+ CPUUtilization +--------+--------+------+--------+------+--------+--------+---------+-------+-------+------------+ | metric | user | nice | system | idle | iowait | irq | softirq | steal | guest | guest_nice | +--------+--------+------+--------+------+--------+--------+---------+-------+-------+------------+ | cv | 0.0074 | 0.0 | 0.0041 | 0.0 | 0.0 | 0.0003 | 0.0007 | 0.0 | 0.0 | 0.0 | +--------+--------+------+--------+------+--------+--------+---------+-------+-------+------------+ CPUStat +--------+--------+--------+------------+ | metric | cswch | intrs | soft_intrs | +--------+--------+--------+------------+ | cv | 0.0327 | 0.0527 | 0.3125 | +--------+--------+--------+------------+ CPULoad +--------+--------+--------+--------+ | metric | load1 | load5 | load15 | +--------+--------+--------+--------+ | cv | 0.1823 | 0.0352 | 0.0147 | +--------+--------+--------+--------+ MemInfo +--------+-------+-----------+---------+--------+--------+--------+----------+---------+--------+--------+------+ | metric | total | available | percent | used | free | active | inactive | buffers | cached | shared | slab | +--------+-------+-----------+---------+--------+--------+--------+----------+---------+--------+--------+------+ | cv | 0.0 | 0.0001 | 0.0 | 0.0003 | 0.0001 | 0.0024 | 0.0002 | 0.0 | 0.0 | 0.0 | 0.0 | +--------+-------+-----------+---------+--------+--------+--------+----------+---------+--------+--------+------+ SwapMem +--------+-------+------+------+---------+-----+------+ | metric | total | used | free | percent | sin | sout | +--------+-------+------+------+---------+-----+------+ | cv | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | +--------+-------+------+------+---------+-----+------+ IO +--------+--------+-----------+-----------+--------------+---------+--------+------------+--------+--------+ | metric | tps | kb_read_s | kb_wrtn_s | kb_discard_s | areq_sz | aqu_sz | await_time | util | DEVICE | +--------+--------+-----------+-----------+--------------+---------+--------+------------+--------+--------+ | cv | 1.1388 | 0.8485 | 1.3792 | 0.0 | 0.0994 | 0.0085 | 0.0061 | 0.0237 | sda | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | sda1 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | sda2 | | | 0.7529 | 0.6408 | 1.3792 | 0.0 | 0.1249 | 0.0 | 0.0219 | 0.0259 | sda3 | | | 0.071 | 0.0 | 1.7111 | 0.0 | 1.8673 | 0.0035 | 0.1098 | 0.0178 | sdb | | | 0.0232 | 0.0 | 1.7111 | 0.0 | 1.3751 | 0.0033 | 0.0824 | 0.0027 | sdb1 | | | 1.2243 | 0.0 | 1.3083 | 0.0 | 0.0103 | 0.0167 | 0.0025 | 0.0304 | dm-0 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | dm-1 | | | 1.2467 | 0.2065 | 2.1096 | 0.0 | 3.1948 | 0.0094 | 0.0569 | 0.0073 | dm-2 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | sdc | +--------+--------+-----------+-----------+--------------+---------+--------+------------+--------+--------+ Network +--------+----------+----------+---------+---------+-----------------+-----------------+----------------+--------+-------------+ | metric | rx_pck_s | tx_pck_s | rx_kb_s | tx_kb_s | rx_compressed_s | tx_compressed_s | rx_multicast_s | util | DEVICE | +--------+----------+----------+---------+---------+-----------------+-----------------+----------------+--------+-------------+ | cv | 0.0636 | 0.0534 | 0.0099 | 0.5153 | 0.0 | 0.0 | 0.0 | 0.0124 | eno1 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | eno2 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | eno3 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | eno4 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | docker0 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | veth1cb3bd9 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | vethf6352c1 | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | vethabea97c | | | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | veth | +--------+----------+----------+---------+---------+-----------------+-----------------+----------------+--------+-------------+ [INFO] Data saved successfully at /home/test/2025_08_14_16_17_04_stability.log
The collected data is displayed in the command output, and the detailed raw data is saved in the /home/test/2025_08_14_16_17_04_stability.log file.
Environment stability check collects performance metrics within a period of time, analyzes the fluctuation of performance metrics, and provides the CV to determine whether the environment is stable. According to the report, the CPU usage CV is low, indicating that the CPU usage is stable during this period. However, the TPS of the sda device under I/O is 1.1388 (greater than 0.15), indicating that memory-intensive services involving sda exist and the sda device usage fluctuates.