Background information
Both the client and OceanBase Database support throttling. To ensure stability throughout the link, OceanBase Database Proxy (ODP) must also support throttling. To improve stability and reduce the impact of throttling on users, ODP supports throttling on remote procedure call (RPC) requests based on the memory usage in V4.3.2 and later.
Description
Throttling is enabled when the memory usage of RPC requests reaches rpc_throttle_trigger_percentage the specified threshold , and rpc_throttle_limit_qps_qa the queries per second (QPS) value is limited to 70% of the QPS when throttling is triggered. When the specified QPS is reached, ODP reads subsequent requests based on rpc_request_throttle_waiting_time the specified wait time . No error is returned throughout the throttling process.
Considerations
To use this feature, make sure that the version of ODP is V4.3.2 or later.
Before you use this feature, make sure that enable_obproxy_rpc_service is set to
true.If the memory usage of RPC requests still increases constantly, ODP stops reading requests and prints logs when the memory usage of RPC requests reaches 70% of the total memory, and continues to read requests when the memory pressure decreases.
Examples
Log in to OceanBase Database through ODP as the
root@sysuser or log in to ODP as theroot@proxysysuser.Here is an example of logging in to OceanBase Database through ODP as the
root@sysuser. For more information about parameters in the following command, see Connect to an OceanBase Database tenant by using OBClient.[admin@obtest ~]$ obclient -uroot@sys#obcluster -h10.10.10.1 -P2883 -pNotice
To use ODP commands in OceanBase Database, the IP address (specified by
-h) and the port (specified by-P) for connecting to OceanBase Database must be the IP address and listening port (specified bylisten_port) of ODP.Here is an example of logging in to ODP as the
root@proxysysuser. The IP address (specified by-h) is the IP address of ODP, and the port (specified by-P) is the listening port (specified bylisten_port) of ODP.[admin@obtest ~]$ obclient -uroot@proxysys -h10.10.10.1 -P2883 -pEnable throttling.
obclient> alter proxyconfig set enable_rpc_throttle=true;Modify the threshold that triggers throttling.
obclient> alter proxyconfig set rpc_throttle_trigger_percentage= 40;Modify the time to wait before ODP reads RPC requests after throttling is triggered.
obclient> alter proxyconfig set rpc_request_throttle_waiting_time= 10ms;Modify the QPS to use after throttling is triggered.
obclient> alter proxyconfig set rpc_throttle_limit_qps_qa= 500;