Overview
Starting with ODP V4.3.5, a session-level connection pool reduces the cost of frequent new client connections to ODP and frequent ODP-to-OBServer connections in short-connection workloads, improving concurrency.
Restrictions
The session connection pool is not available if any of the following applies:
The client uses a service name. For details, see Automatic routing to the primary/standby tenants.
ODP
server_protocoliscompressed mysql. Runshow proxyconfig like 'server_protocol';to check.The client uses an Oracle tenant.
The client has used distributed transactions.
The client uses OceanBase 2.0 protocol between client and ODP.
The client uses SSL.
The request is a BINLOG request.
Version requirements
ODP V4.3.5 or later and OceanBase Database V4.4.0 or later.
Usage
Parameters
Enable the pool by modifying the connection_pool_mode parameter, for example:
obclient> alter proxyconfig set connection_pool_mode='session';
The following parameters tune the pool; defaults are recommended:
Parameter |
Default |
Description |
|---|---|---|
| session_pool_idle_timeout | 5m | Maximum time a returned session may stay idle in the pool. |
| session_pool_reset_interval | 10m | Interval for sending COM_RESET_CONNECTION to sessions in the pool that have not been reset. |
| session_pool_stat_log_interval | 1m | Interval for session pool statistics logs. |
Administration commands
View sessions
Log in to the cluster
systenant asrootand runSHOW GLOBALSESSION. To view a tenant’s sessions, see SHOW GLOBALSESSION.[admin@obtest ~]$ obclient -uroot@sys#obcluster -h10.10.10.1 -P2883 -pSHOW GLOBALSESSION ATTRIBUTE 'obcluster:test'\GExample output:
*************************** 1. row *************************** dbkey_name: obcluster:test auth_user: admin@test#obcluster server_ip: 10.10.10.1:25706 local_ip: 10.10.10.2:35950 session_state: KEEP_ALIVE_GLOBAL_SHARED server_session_id: 3222004961 ss_id: 193 create_time: 2025-04-08 16:55:26.458191 last_release_time: 2025-04-08 16:55:38.803114 timeout_time: 2025-04-08 17:25:38.803114 *************************** 2. row *************************** dbkey_name: obcluster:test auth_user: admin@test#obcluster server_ip: 10.10.10.1:25704 local_ip: 10.10.10.2:33250 session_state: KEEP_ALIVE_GLOBAL_SHARED server_session_id: 3221679414 ss_id: 43 create_time: 2025-04-08 16:41:00.410908 last_release_time: 2025-04-08 16:55:38.803067 timeout_time: 2025-04-08 17:25:38.803067Terminate sessions
As
rootonsys, runKILL GLOBALSESSION. See KILL GLOBALSESSION.[admin@obtest ~]$ obclient -uroot@sys#obcluster -h10.10.10.1 -P2883 -pKILL GLOBALSESSION 'obcluster:test' 193;Replace
193with thess_idfromSHOW GLOBALSESSIONoutput.
