shardingsphere proxy 5.1.0使用JMeter 接口压测出现数据库连接不可用

压测刚开始的时候还是正常的,当压测两三分钟之后,proxy开始报错,提示HikariPool-2 - Connection is not available, request timed out after 30000ms.

java服务配置的数据库连接配置如下:
spring.datasource.url=jdbc:mysql://10.10.16.10:31454/sharding_db?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.hikari.connectionTimeout=30000
spring.datasource.hikari.idleTimeout=30000
spring.datasource.hikari.keepaliveTime=60000
spring.datasource.hikari.maxLifetime=1800000
spring.datasource.hikari.maximumPoolSize=10

shardingsphere-proxy server配置如下:
mode:
type: Cluster
repository:
type: ZooKeeper
props:
namespace: governance_ds
server-lists: 10.10.16.90:2181
retryIntervalMilliseconds: 500
timeToLiveSeconds: 60
maxRetries: 3
operationTimeoutMilliseconds: 500
overwrite: false

rules:

  • !AUTHORITY
    users:
    • root@%:root
    • sharding@:sharding
      provider:
      type: ALL_PRIVILEGES_PERMITTED
  • !TRANSACTION
    defaultType: XA
    providerType: Atomikos
  • !SQL_PARSER
    sqlCommentParseEnabled: true
    sqlStatementCache:
    initialCapacity: 2000
    maximumSize: 65535
    concurrencyLevel: 4
    parseTreeCache:
    initialCapacity: 128
    maximumSize: 1024
    concurrencyLevel: 4

props:
max-connections-size-per-query: 1
kernel-executor-size: 16
proxy-frontend-flush-threshold: 128
proxy-opentracing-enabled: false
proxy-hint-enabled: true
sql-show: true
check-table-metadata-enabled: false
show-process-list-enabled: false
proxy-backend-query-fetch-size: -1
check-duplicate-table-enabled: false
proxy-frontend-executor-size: 0
proxy-backend-executor-suitable: OLTP
proxy-frontend-max-connections: 0
sql-federation-enabled: false
proxy-backend-driver-type: JDBC

config-sharding的配置如下:
schemaName: sharding_db
dataSources:
wey_test:
url: jdbc:mysql://10.200.16.13:3306/db?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: ***
password: ***
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1

rules:

  • !SHARDING
    defaultDatabaseStrategy:
    none:
    defaultTableStrategy:
    none:
京ICP备2021015875号