What is the worst that would happen if I delete all of my SQLite databases and restart storagenode?

Sorry, @Alexey, I wrote this post while you were splitting the topic. Please move this post too. :slight_smile:


Yes, I agree. But again, that discussion is totally irrelevant to whether the databases are stored in a ramdisk. Whatever RAM is free is used for the I/O cache so if you are picking between corrupting a DB in RAM or corrupting the I/O cache, you’re going to have a bad time either way.

If the databases are not critical for node operation and can rebuilt, then it doesn’t actually matter. That’s why I want to hear from @Alexey on this topic.

I don’t care about any metrics I’d lose in the database if they don’t impact node operation. I have a separate monitoring server that collects and records historical data, so the metrics in the node database is redundant to me.

Seeing 1-2 orders of magnitude improvement on DB writes that are already contending for disk IOPS isn’t an improvement? Okay…

Keep in mind that sync() on RAM is ~free; the data is already there. On an SSD it means pushing a write buffer to NAND cells and there is still some latency on that. Not as much as an HDD but still significantly more than on RAM.

This is the only point that I will concede – you are going to shrink the available RAM for the I/O cache. But keep in mind that, at least on Linux, the contents of a ramdisk can be swapped to disk. This has the net effect of ejecting DB pages not used to swap. If your swap is on SSD then you only get the addition performance hit of writing the database to disk when the system decides it is advantageous to free up RAM. So you’ll see significantly better DB performance in the average case, and in the worst case you’ll see the same performance as using an SSD as storage (which would be rare as the swapping algorithm is pretty good about deciding what to swap out when there is a lot of free RAM).

For reads, sure. For writes you still need to have writethrough to some kind of persistent storage, even if it’s an SSD cache that does writeback to an HDD, and writes are where you see the contention. During writes, you cannot even read from the database so writes must be fast.

Uncontended reads on the database should generally be of no consequence with or without ZFS.