Jbd2 continuously writes to the hard disk

Recently I noticed that vyos has been writing continuously at a speed of about 40kb per second. Through iotop, it was found that jbd2 would write to disk every few seconds, as well as ext4-rsv-conversion. I don’t have any complicated business, just a home gateway, but continuous writing will reduce the life of the SSD. I have observed other systems and found that jbd2 is also written, but it is not so frequent and fixed.
Has anyone else encountered it?

vyos version is 1.4-rolling-202108181544

I have encountered the same issue on 1.2.x, and thus most likely it has the same source as in case of your 1.4.

The main reason (in case of 1.2.x) is the logging daemon (rsyslog in case of 1.2.x) that writes some logs once in a while.

The jdb2 “process” you are seeing is actually the kernel’s Ext3/Ext4 journal flush thread.

In order to solve this issue I would suggest either increasing the Ext3/Ext4 journal commit time, and increasing the “dirty buffer cache flushing” timeout, both which are kernel parameters. (Although this can have serious consequences in case of dataloss.)

The other alternative would be to either disable the logging daemon, or configure it to write in a tmpfs store. (However this way you won’t have access to logs.)

In case 1.4 doesn’t use rsyslog but instead uses journald then you can configure journald to flush less often, or not to use memory storage, and so you’ll have access to your logs, but they won’t be permanent.

You are right. After careful observation, it is indeed caused by journald. About 1.2GB is written per hour.

I don’t know why there is such a large amount of writing for the time being, I choose to temporarily close it.
Thank you very much for your feedback.Further research is still being done.