Load balancing is an important aspect of performance tuning, which includes two aspects: load balancing within the cluster and load balancing of business traffic. Good load balancing can fully utilize the software and hardware environment and achieve the best performance. During stress testing, you need to pay attention to the resource usage of each OBServer node in the cluster, such as CPU, I/O, and load. This topic briefly describes cluster deployment and resource distribution.
Cluster deployment
For a cluster deployment, information about locations, latency, and bandwidth is needed.
Location
Location information is crucial, and some critical information such as the IDC and deployment method affects SQL routing and forwarding, the transaction model, and performance. It includes the following aspects:
Deployment method: same-city three IDCs, two regions with three data centers, three regions with five data centers, or other deployment methods.
Location of OBProxy and other middleware: whether they are deployed on the client side or co-located with OBServer nodes. Different deployment modes have different performance impacts.
Locations of application servers and other middleware.
You can use the following SQL query to view the IDC of each zone in the cluster and the city where the IDC is located:
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_ZONES;
The query result is as follows:
+-------+----------------------------+----------------------------+--------+------+----------------+-----------+
| ZONE | CREATE_TIME | MODIFY_TIME | STATUS | IDC | REGION | TYPE |
+-------+----------------------------+----------------------------+--------+------+----------------+-----------+
| zone1 | 2024-07-10 14:19:05.573991 | 2024-07-10 14:19:05.573991 | ACTIVE | | default_region | ReadWrite |
+-------+----------------------------+----------------------------+--------+------+----------------+-----------+
1 row in set
Latency
You can assess the response time (RT) of an SQL statement based on the latency information. The specific latency information of the cluster is as follows:
Latency between IDCs;
Latency between zones;
Latency from OBProxy to OBServer nodes;
Latency from clients to OBProxy.
Bandwidth
You need to confirm the bandwidth of the following components:
Bandwidth of the NIC of the machine where OBProxy is installed.
Bandwidth of the NIC of the application server.
NIC bandwidth and disk I/O bandwidth of OBServer nodes.
You can obtain this information by using commands such as ping, tsar, ethtool xxx, and ifconfig. The following example uses the FFF deployment with three IDCs in the same city and three replicas.
Resource distribution
Understand the tenant resource distribution to prepare for subsequent performance diagnosis.
Basic tenant information
This includes the primary zone and locality. The related SQL query is as follows:
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TENANTS LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1
TENANT_NAME: sys
TENANT_TYPE: SYS
CREATE_TIME: 2026-02-10 10:34:01.635622
MODIFY_TIME: 2026-02-10 10:34:01.635622
PRIMARY_ZONE: RANDOM
LOCALITY: FULL{1}@zone1
PREVIOUS_LOCALITY: NULL
COMPATIBILITY_MODE: MYSQL
STATUS: NORMAL
IN_RECYCLEBIN: NO
LOCKED: NO
TENANT_ROLE: PRIMARY
SWITCHOVER_STATUS: NORMAL
SWITCHOVER_EPOCH: 0
SYNC_SCN: NULL
REPLAYABLE_SCN: NULL
READABLE_SCN: NULL
RECOVERY_UNTIL_SCN: NULL
LOG_MODE: NOARCHIVELOG
ARBITRATION_SERVICE_STATUS: DISABLED
UNIT_NUM: 1
ZONE_UNIT_NUM_LIST: zone1:1
COMPATIBLE: 4.6.0.0
MAX_LS_ID: 1
RESTORE_DATA_MODE: NORMAL
FLASHBACK_LOG_SCN: NULL
COMMENT: system tenant
PROTECTION_MODE: NULL
PROTECTION_LEVEL: NULL
1 row in set
Resource allocation information
The related SQL query is as follows:
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.gv$ob_units LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
SVR_IP: 172.xx.xx.xx
SVR_PORT: 2882
UNIT_ID: 1
TENANT_ID: 1
ZONE: zone1
ZONE_TYPE: ReadWrite
REGION: default_region
MAX_CPU: 4
MIN_CPU: 4
MEMORY_SIZE: 5368709120
MAX_IOPS: 9223372036854775807
MIN_IOPS: 9223372036854775807
IOPS_WEIGHT: 4
LOG_DISK_SIZE: 17448304640
LOG_DISK_IN_USE: 2311121885
DATA_DISK_IN_USE: 88608768
STATUS: NORMAL
CREATE_TIME: 2025-10-15 11:13:02.088335
REPLICA_TYPE: FULL
1 row in set
Total number of user partitions per server and leader distribution
obclient [oceanbase]> SELECT svr_ip,count(1) FROM oceanbase.__all_virtual_ls_meta_table WHERE tenant_id=1002 GROUP BY svr_ip;
+---------------+----------+
| svr_ip | count(1) |
+---------------+----------+
| 10.10.10.1 | 1 |
| 10.10.10.2 | 1 |
| 10.10.10.3 | 1 |
+---------------+----------+
3 rows in set
obclient [oceanbase]> SELECT svr_ip,count(1) FROM oceanbase.__all_virtual_ls_meta_table WHERE tenant_id=1001 and role=1 GROUP BY svr_ip;
+---------------+----------+
| svr_ip | count(1) |
+---------------+----------+
| 10.10.10.1 | 5 |
+---------------+----------+
1 row in set
Other
Any component that processes requests from the application server to the OBServer node is a key focus area. A bottleneck at any point can significantly impact performance. Pay attention to the following aspects:
Physical resources: whether the resources of each component in the intermediate link are reaching bottlenecks, such as the JVM memory, the CPU usage of the application server and OBProxy, and soft interrupts.
Request routing: whether OBProxy can correctly route SQL requests and whether there are any routing errors.
Connection pool: the numbers of long and short connections and the SocketTimeout configuration.
Traffic balancing: whether there is a severe imbalance in the number of SQL statements received and processed by each OBServer node.