Bandwidth between the standby and primary tenants can be a scarce resource in certain business scenarios (for example, cross-region disaster recovery). It needs to be used reasonably and with appropriate rate limiting.
OceanBase Database provides the following two cluster-level parameters for standby tenant rate limiting:
standby_fetch_log_bandwidth_limit: Used to set the total bandwidth available in the cluster where the standby tenant is located for log synchronization from the primary or source tenant to the standby tenant. The value range is [0, 10000G]. The default value is0, which means no bandwidth limit. Modifications take effect immediately.After the
standby_fetch_log_bandwidth_limitparameter is modified, OceanBase Database uses an adaptive allocation policy to redistribute appropriate bandwidth upper limits among multiple OBServer nodes in the cluster, so as to maximize the utilization of bandwidth resources._server_standby_fetch_log_bandwidth_limit: Used to set the bandwidth available for log synchronization from the primary or source tenant to the standby tenant for a single OBServer node in the cluster where the standby tenant is located. The value range is [0, 1000G]. The default value is0, which means no server-level rate limiting; it uses the bandwidth allocated based on thestandby_fetch_log_ratelimitparameter. Modifications take effect immediately.After the
_server_standby_fetch_log_bandwidth_limitparameter is modified, the OBServer nodes with rate limiting set will preferentially use this limit value, and the limit value configured bystandby_fetch_log_bandwidth_limitwill be allocated to the remaining OBServer nodes. That is, if bothstandby_fetch_log_bandwidth_limitand_server_standby_fetch_log_bandwidth_limitare set, the total bandwidth available for the cluster is the sum of the two.
Considerations
It is not recommended to set the bandwidth limit for the standby tenant too small. In production environments, you need to evaluate the potential impact of rate limiting on your business, such as continuous lagging or log stream interruption of the standby tenant.
In OceanBase Database, parameters whose names start with an underscore (_) are called hidden parameters. They are for use by developers only during troubleshooting or emergency maintenance.
Procedure
Log in to the
systenant of the cluster where the standby tenant is located, using therootuser.Execute the following command to set the rate limit for the standby tenant.
Set the total available bandwidth for the cluster
ALTER SYSTEM [SET] standby_fetch_log_bandwidth_limit = value;Here is an example:
ALTER SYSTEM SET standby_fetch_log_bandwidth_limit = '50M';Set the available bandwidth for a single OBServer node
ALTER SYSTEM [SET] _server_standby_fetch_log_bandwidth_limit = value SERVER [=] 'svr_ip:svr_port';where:
svr_ip: the IP address of the OBServer node to be configured.svr_port: the RPC port number of the OBServer node to be configured.- Only one OBServer node can be specified.
Example:
ALTER SYSTEM SET _server_standby_fetch_log_bandwidth_limit = '30M' SERVER = 'xx.xx.xx.xx:17854';