Simulate Block Device Latency
note
BlockChaos is in an early stage. The installation and configuration experience of it will continue to improve. If you find any issues, please open an issue in to report.
BlockChaos depends on the kernel module. It can only be injected on a machine with this module installed. Currently, you have to compile and install the module manually.
Download the source code of this module using the following command:
-
If you are using Ubuntu/Debian, you can install the kernel headers with
apt
:apt install linux-headers-$(uname -r)
Compile the module:
The chaos_driver
module has to be installed every time after rebooting. To load the module automatically, you can copy the module to a subdirectory in /lib/modules/$(uname -r)/kernel/drivers
, run depmod -a
, and then add chaos_driver
to the /etc/modules
.
If you have upgraded the kernel, the module should be recompiled.
It is recommended to use DKMS or akmod for automatic kernel module compiling or loading. If you want to help us improve the installation experience, creating a DKMS or akmod package and submitting it to different distribution repositories is very welcome.
Write the experiment configuration to the YAML configuration file. The following uses the
block-latency.yaml
file as an example.note
Only hostpath or localvolume is supported.
Use to create an experiment:
kubectl apply -f block-latency.yaml
- The
ioem
orioem-mq
scheduler will receive the latency request and delay the request for the specified time.
The fields in the YAML configuration file are described in the following table: