Can someone give more detailed explanations on what the various db-sync-mode parameters actually do in monerod and monero-blockchain-import, and why one might select each of them? (i.e. safe, fast, fastest; sync, async; and nblocks_per_sync)

Also, how might each parameter impact a node's CPU, RAM, and HDD/SSD use when selecting them and syncing from scratch?

  • i would really like to know this too
    – Sozimajor
    Commented Jun 6, 2021 at 14:38
  • And which is the default? And how do I set n when using nblocks_per_sync?
    – ki9
    Commented Mar 20, 2023 at 16:38

1 Answer 1


safe: at each txn commit, the data is flushed to the disk (happens every block)

fast: the OS is left to make the decision when to flush to disk

fastest: the OS is left to make the decision, not sure the difference with fast. I think it also avoids explicitely flushing medadata, but I'm not 100% sure.

sync vs async: sync will wait for a flush to be done before continuing, while async will continue right after issuing the sync instruction, not waiting until the OS reports the operation is finished.

nblocks_per_sync is how often to request a flush. The higher the number, the longer monero will work before asking for a flush. This speeds things up, unless you start having so much queued up that you start swapping. However, it increases the danger of corruption if your database is on a flaky OS/hardware.

On a spinning HDD, actual hardware writes are very slow, so you want to keep the data cached as much as you can before hitting the disk.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.