.Net Client Configuration: What is EnableConfigHeartBeat?


#1

I’m a bit confused about the config settings EnableConfigHeartBeat and HeartBeatConfigInterval. The description of the latter is:
“Sets the interval for configuration “heartbeat” checks, which check for changes in the configuration that are otherwise undetected by the client.”

My interpretation is that this (which is enabled by default) will check every 10 seconds if the couchbase client configuration has changed, and if so, re-read it. However, this doesn’t make sense to me. If I use configuration in code, the application will need to be recompiled and restarted for a config change. If I use web.config configuration, any change to the web.config file will trigger a restart of the app pool. So how could a change ever be “undetected”?

So now I am wondering what the point of this “heartbeat” is. If it indeed works as I assume, it would only be a performance hit that serves no purpose.


#2

Hi @mathiasr,

This one is not about client configuration changes, but rather cluster changes, like a rebalance, adding a node, removing a node, etc…

The cluster sends a “cluster map” to the client, which uses it to go directly to the right node eg. when performing a GET.

Usually this is automatically performed by the server when said topology changes, but this heartbeat ensures that no matter what, every HeartBeatConfigInterval milliseconds (IIRC it’s millis), we ask the server if the topology/configuration changed.


#3

Ah, well that makes much more sense! Thank you!