Tuning OBProxy
Adjust OBProxy parameters to improve the OceanBase performance.
Method
This section provides tuning suggestions for the CPU parameters of OBProxy. After modifying the parameters, restart the OBProxy for the modification to take effect.
Parameter |
Description |
Suggestion |
|---|---|---|
work_thread_num |
The number of OBProxy worker threads. This parameter has a great impact on the CPU usage. The default value is 8. |
Dynamically adjust the value based on the environment. The upper limit of the OBProxy CPU usage is the value of this parameter. |
automatic_match_work_thread |
Specifies whether to automatically create worker threads based on the number of CPU cores. The default value is true. When the value is true, the maximum number of worker threads is the value of work_thread_num. |
|
enable_compression_protocol |
Enables or disables the compression protocol. Boolean type. The function is enabled when the value is true, and the function is disabled when the value is false. |
Recommended value is false to reduce the CPU usage of OBProxy. |
Viewing and Modifying OBProxy Parameters
- Use OBClient to connect to OceanBase.
obclient -h127.0.0.1 -P2883 -uroot@sysbench_tenant -Doceanbase -A
- 127.0.0.1 and 2883 are the IP address and port number of the OceanBase server respectively.
- root is the database user, and sysbench_tenant is the database tenant.
- oceanbase is the name of the OceanBase database.
- View Proxy parameters. For example, view the enable_compression_protocol parameter:
SHOW PROXYCONFIG LIKE 'enable_compression_protocol';
- Set Proxy parameters.
ALTER PROXYCONFIG SET enable_compression_protocol = ture;
- Restart the OceanBase cluster.
The modification of some parameters takes effect only after the OceanBase cluster is restarted.
obd cluster restart obcluster