Does anybody know why k3s produces such high disk ...
# k3s
m
Does anybody know why k3s produces such high disk activity with a default Rancher installation on Linux Ubuntu? I am wondering why a fresh new k3s installation (
curl -sfL <https://get.k3s.io> | sh -
) still produces disk write activity after some time, even though I have nothing else installed. I used the command
pidstat -d 1
and observed that
kB_wr/s
doesn’t go below 40–50 kB/s. Is this normal behavior? What exactly is k3s writing to disk? 091214 UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command 091215 0 11702 0.00 52.00 0.00 0 k3s-server 091229 0 11702 0.00 40.00 0.00 0 k3s-server 091235 0 11702 0.00 64.00 0.00 0 k3s-server
q
Kubernetes writes lots of events to the datastore all the time, so it will always be writing. If you are using the embedded etcd (which I guess is the default), that will probably be the reason.
m
I’ve done some further investigation and found that Kubernetes generates a large number of INSERT operations into the kine table. To persist Kubernetes object states. Each transaction is committed individually, which means it must first be written to the WAL (Write-Ahead Log) file—resulting in significant disk write activity. I tested two approaches to reduce this: • tmpfs (RAM disk): • This eliminates disk writes entirely, but introduces the need for periodic database backups to retain at least some persistence in case of a Kubernetes shutdown or crash. • External database (PostgreSQL): • I used PostgreSQL as the backing datastore and experimented with enabling wal_compression to reduce the size of WAL files. However, this had minimal-medium impact on the overall disk write volume.