Sqlite and periodic drive activity

I’m trying to figure out if this is just normal for sqlite, or a docker issue, or a bitwarden_rs issue, and if it is adjustable. I pointed the DB directory to a mass storage drive which I’d like to put to sleep whenever not in use. I don’t use bitwarden daily or even weekly some weeks, so I’m fine having the drive sleep for days at a time, to cut down on noise, heat, and energy. However, the drive will not stay asleep. I’m running Ubuntu Server 18.04.5 LTS. Turning on /proc/sys/vm/block_dump and checking dmesg, I’m seeing
r2d2-worker-1… dirtied inode … (db.sqlite3) on sdg, followed by block writes. This happens maybe every 5 minutes or so, and I’d rather it not. Any help tracing why the DB updates so frequently when I’m not interacting with BW.

I have the exact same issue as highlighted in this post 2 years ago. Could someone kindly provide some feedback? Thank you.

There are multiple items which trigger database activity.
The alive check for example. There are a few cron/periodic checks which trigger it.

Thank you. Are there options to disable them? I believe many users would like this to be a system that is as static as possible.

I have never seen the question before, besides here.

I’m not sure if you can fully disable it actually. But that mostly depends on your Docker environment and if you can prevent the healthcheck from running.

You can disable the crons/jobs by setting the following env JOB_POLL_INTERVAL_MS=0. But that will disable all those jobs, and will disable some notification and cleaning features.

But how to disable the healthcheck, i have no clue. Normally via the docker cli it would be –no-healthcheck. That is something you need to check your host system on how to stop those.

I recently ran into the same problem. In my setup I want to include Vaultwarden in my personal cloud running on a Raspberry Pi 3. Vaultwarden also kept my external USB hard disk from spinning down. I tracked it back to a file called db.sqlite3-wal whose last change timestamp was never older than 5 minutes, even though the file size was always 0.

Turning off WAL by following Running without WAL enabled · dani-garcia/vaultwarden Wiki · GitHub solved the issue for me. At least for an empty vault, I didn’t check with any productive data yet. I also didn’t do any long term observation yet, my setup was just running a backup every 1h and I was pleased to observe that the disk spun down each hour, 30 minutes after the backup took place.

Maybe there is more to fine-tune concerning the periodic services like checking for password leaks, but I think the WAL thing was the first puzzle piece, so I wanted to let you know.