Common client settings
Common client settings can be modified via the lcb_cntl() API.
Operation timeouts
Operation timeouts set the upper limit on the time the library will wait for an operation to receive a reply before invoking the callback for the operation with an error code of LCB_ETIMEDOUT. When using the library in blocking mode this also determines the amount of time your program can block before having control returned to your application. You should generally modify timeouts if you are in blocking mode and your application has a requirement for faster responsiveness (in this case, the timeouts should be lowered at the risk of receiving higher errors during network slowdowns) or if you have a slow network (in which case the timeouts should be increased, potentially increasing the time your application blocks).
Setting | Description |
---|---|
LCB_CNTL_OP_TIMEOUT | The timeout setting for key-value operations |
LCB_CNTL_VIEW_TIMEOUT | The timeout setting for view requests. In this sense, it means HTTP operations created with LCB_HTTP_TYPE_VIEWS |
LCB_CNTL_DURABILITY_TIMEOUT | The timeout setting indicating how long to poll the nodes to ensure the persistence and/or replication of items to their respective nodes |
LCB_CNTL_HTTP_TIMEOUT | The timeout setting for HTTP operations created with LCB_HTTP_TYPE_MANAGEMENT |
Bootstrap options
Setting | Description |
---|---|
LCB_CNTL_CONFIGURATION_TIMEOUT | Controls the total amount of time to wait for a new configuration to be received from the cluster. This is mainly useful during the initial bootstrap process (i.e. lcb_connect()). This sets the maximum amount of time that the library will spend trying to retrieve a configuration before the bootstrap callback is invoked with an error (and/or lcb_wait() returns after an initial lcb_connect()). |
LCB_CNTL_CONFIG_NODE_TIMEOUT | When retrieving a configuration, this determines the maximum amount of time to wait for a node to respond before requesting the configuration from the next node in the list. Note that the LCB_CNTL_CONFIGURATION_TIMEOUT overrides this option - in the sense that the client will never wait any longer than LCB_CNTL_CONFIGURATION_TIMEOUT time to retrieve the initial configuration. |
LCB_CNTL_RANDOMIZE_BOOTSTRAP_HOSTS | When the library receives multiple nodes in the connection string (or there are multiple nodes in the cluster), it will start contacting the first node in the list and progress onwards when a new configuration is required. This setting determines whether this access should be random or whether to contact the nodes in the order they were passed. |