apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
19.96k stars 6.74k forks source link

sharding proxy thread pool type is fixed #22517

Closed hua74ni closed 1 year ago

hua74ni commented 1 year ago

Feature Request

Is your feature request related to a problem?

Start the proxy using yaml configuration, there is no configuration to modify the datasourcePool. Sharding-proxy create a thread pool type is fixed -- "com.zaxxer.hikari.HikariDataSource"

image

image

Describe the feature you would like.

Start the proxy using yaml configuration, hoping that the configuration can modify the datasourcePool

strongduanmu commented 1 year ago

Hi @hua74ni thank you for your feedback. Currently Proxy uses hikari as the default connection pool. Do you have a need to replace the connection pool?

hua74ni commented 1 year ago

Hi @hua74ni thank you for your feedback. Currently Proxy uses hikari as the default connection pool. Do you have a need to replace the connection pool?

Hybrid Architecture,Proxy uses hikari as the default connection pool,JDBC can only be hikari as well. Or I don't understand it right?

sandynz commented 1 year ago

Hybrid Architecture,Proxy uses hikari as the default connection pool,JDBC can only be hikari as well. Or I don't understand it right?

Yes, looks it's true. dataSourceClassName: com.zaxxer.hikari.HikariDataSource is persisted in logic database metadata. e.g.

ds_1:
  password: root
  minPoolSize: '1'
  dataSourceClassName: com.zaxxer.hikari.HikariDataSource
  idleTimeoutMilliseconds: '60000'
  maxPoolSize: '20'
  url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
  username: root
RaigorJiang commented 1 year ago

Yes, Proxy chose Hikari mainly for performance reasons.

When users use a hybrid architecture, JDBC also uses Hikari, which is consistent with the default connection pool used by SpringBoot.

Proxy may also support other connection pools in the future, but there are no plans yet.