Skip to main content
Version: latest

top_blockio

The top_blockio gadget provides a periodic list of input/output block device activity. This gadget requires Linux Kernel Version 6.5+.

Note: If you have an encrpyted disk some block IO operations will not be shown, since device mappers are in between these operations to operate transparently. See https://docs.kernel.org/admin-guide/device-mapper/dm-crypt.html

Getting started

Running the gadget:

$ kubectl gadget run ghcr.io/inspektor-gadget/gadget/top_blockio:latest

Guide

Run a pod / container:

$ kubectl run --restart=Never --image=busybox test-top-blockio -- sh -c 'while true; do dd if=/dev/zero of=/tmp/test count=4096; sync; sleep 0.2; done'
pod/test-top-blockio created

Then, run the gadget and see how it shows the sync process:

$ kubectl gadget run top_blockio:latest
K8S.NODE K8S.NAMESPACE K8S.PODNAME K8S.CONTAINERNAME PID MAJOR MINOR COMM BYTES US IO RW
minikube default test-top-blockio test-top-blockio 8086 8 0 sync 81920 45 1 wr…
minikube default test-top-blockio test-top-blockio 8055 8 0 sync 606208 547 3 wr…
minikube default test-top-blockio test-top-blockio 8082 8 0 sync 65536 95 2 wr…
minikube default test-top-blockio test-top-blockio 8084 8 0 sync 147456 95 2 wr…
...

Finally, clean the system:

$ kubectl delete pod test-top-blockio