Persistence/ How to configure time to persist data

I am using Couchbase Server in version 4.5.1. I could not find any information if there is a guaranteed time after which changes in database stored in memory will be persisted? Maybe it is configurable like in e.g. in Cassandra we have commitlog_sync_period_in_ms parameter ( )?

Thank you for help!

Couchbase will attempt to persist to disk as soon as possible, so the time will be related to how fast your disk subsystem is.

You can monitor the persistTo times from the UI - see the disk commit time in the Bucket statistics page

Note: You mention “guarantee” - in general a userspace application can never guarantee any specific time to write data to disk, as that’s under the control of the OS. If you have a slow disk / filesystem then you could in theory be waiting for an arbitrary amount of time for data to be written to disk.

I think the question was not about how much time the syncing will take, but how often it will be attempted…

A flush to disk will be queued as soon as there’s at least 1 outstanding item to flush for a given vBucket. Depending on the number of buckets, number vBuckets on a node, number of writer threads will affect how quickly the Task to flush a particular vBucket will be run.

Hence suggesting looking at the stats - the TL;DR is: “as quickly and as often as possible”.

1 Like