You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "silence1005 (via GitHub)" <gi...@apache.org> on 2023/07/19 14:19:42 UTC
[GitHub] [shardingsphere] silence1005 opened a new issue, #27310: 为什么会有多个HikariPool ? 2个都需要配置吗?
silence1005 opened a new issue, #27310:
URL: https://github.com/apache/shardingsphere/issues/27310
想请教下 ,我这种配置有啥问题么? 项目启动后, 有3个HikariPool , 操作数据库时, 一直使用pool -1 , 但pool -1 默认最大连接数只有10. 多线程的情况下, pool - 1 会报错 , 提示无法获取链接, pool -3 连接池是够用的,它的连接数等于我配置的, 但一直pool - 3 没怎么被访问. 请问连接池相关的数据我在pool -1里也得再配置一遍么?
补充:
1. 我的项目只使用到了分表 , 没有费分库, 因此只有一个ds。
2. 我有40个任务需要用到数据库连接, 核心线程池是15 ,debug模式下, 我发现: 一次性开启15个线程 , 它全部从是pool -1 获取连接,然后再获取连接时,偶尔从pool - 3获取。
3. 现在报错提示: pool -1 无法获取连接。 它是调用了hikari里面的borrow方法, shareList数量是10 ,无法获取链接,进入等待,然后就超时并报错。
4. pool -3 里面 shardList大小等于我配置 : 60
------------------English-----------------------
I would like to ask, is there any problem with my configuration? After the project starts, there are 3 HikariPools. When operating the database, pool -1 is always used, but the default maximum number of connections of pool -1 is only 10. In the case of multi-threading, pool - 1 will report an error, indicating that the connection cannot be obtained. The connection pool of pool -3 is sufficient, and its number of connections is equal to what I configured, but pool - 3 has not been accessed much. Please tell me the data related to the connection pool. I am in pool -1 Do I have to configure it again? Supplement: 1. My project only uses sub-tables, there is no sub-library, so there is only one ds. 2. I have 40 tasks that need to use database connections. The core thread pool is 15. In debug mode, I found that: 15 threads are opened at one time, all of which get connections from pool -1, and then get connections occasionally. Get it from pool-3. 3. Now report an error message: pool -1
cannot obtain a connection. It calls the borrow method in hikari, the number of shareList is 10, it cannot get the link, enters the wait, and then times out and reports an error. 4. The size of shardList in pool-3 is equal to my configuration: 60





--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] silence1005 commented on issue #27310: Why there are multiple HikariPools
Posted by "silence1005 (via GitHub)" <gi...@apache.org>.
silence1005 commented on issue #27310:
URL: https://github.com/apache/shardingsphere/issues/27310#issuecomment-1642264706
Thank you for your answer! In fact, I solved my error problem by configuring the POOL -1 connection pool parameter yesterday. But what I am tangled is that as long as it involves the related configuration of the connection pool, I have to repeat the configuration on the POOL -1 when I configure it in POOL -3? And why most of the database requests are implemented by POOL -1 instead of POOL -3?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on issue #27310: Why there are multiple HikariPools
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #27310:
URL: https://github.com/apache/shardingsphere/issues/27310#issuecomment-1642223547
Hi @silence1005 , **For English only**, other languages will not accept.
When using springboot, pool-1 is the connection obtained by your application from `ShardingSphereDataSource`, and pool-3 is the connection obtained by `ShardingSphereDataSource` from mysql.
(pool-2 should be used for test connection and has been closed)
In `sharding-dev.yaml`, the `maxPoolSize` you configure only affects the number of connections `ShardingSphereDataSource` obtains from mysql, and pool-1 uses the default configuration of hikari `maximumPoolSize` 10 because there is no configuration. (Ref https://github.com/brettwooldridge/HikariCP `maximumPoolSize`)
You can specify the size of pool-1 by `spring.datasource.hikari.maximum-pool-size`=xx
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on issue #27310: Why there are multiple HikariPools
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #27310:
URL: https://github.com/apache/shardingsphere/issues/27310#issuecomment-1642985692
Pool-1 is your application getting connections from ShardingSphereDataSource, pool-3 is ShardingSphereDataSource getting connections from mysql, and their scopes are different.
Maybe you can enable hikari logging to find out more information.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] github-actions[bot] commented on issue #27310: Why there are multiple HikariPools
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #27310:
URL: https://github.com/apache/shardingsphere/issues/27310#issuecomment-1712590984
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang closed issue #27310: Why there are multiple HikariPools
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #27310: Why there are multiple HikariPools
URL: https://github.com/apache/shardingsphere/issues/27310
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] Pinkman-oss commented on issue #27310: Why there are multiple HikariPools
Posted by "Pinkman-oss (via GitHub)" <gi...@apache.org>.
Pinkman-oss commented on issue #27310:
URL: https://github.com/apache/shardingsphere/issues/27310#issuecomment-1672405883
>
Since the configuration of our data source will take effect in pool3, if I configure the druid used by the data source, will pool-3 also use the druid?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on issue #27310: Why there are multiple HikariPools
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #27310:
URL: https://github.com/apache/shardingsphere/issues/27310#issuecomment-1713056381
> >
>
> Since the configuration of our data source will take effect in pool3, if I configure the druid used by the data source, will pool-3 also use the druid?
ShardingSphere can support any connection pool, but some special attributes of druid may not work well, such as filter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org