dengzhhu653 commented on PR #3817:
URL: https://github.com/apache/hive/pull/3817#issuecomment-1340567809

   Change the `TxnHandler#connPoolMutex` from a fixed size connection pool to a 
dynamic size(2 ~ maxPoolSize) pool, so that HMS won't suffer from starvation of 
connection or establish numerous connections to underlying database, Tested 
HikariCP, the pool can grow or shrink on demand:
   
   > 2022-12-07T06:45:55,589 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
After cleanup  stats (total=3, active=1, idle=2, waiting=0)
   2022-12-07T06:46:25,587 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
Before cleanup stats (total=10, active=10, idle=0, waiting=294)
   2022-12-07T06:46:25,587 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
After cleanup  stats (total=10, active=10, idle=0, waiting=294)
   2022-12-07T06:46:55,588 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
Before cleanup stats (total=7, active=1, idle=6, waiting=0)
   2022-12-07T06:46:55,588 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
After cleanup  stats (total=7, active=1, idle=6, waiting=0)
   2022-12-07T06:47:25,591 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
Before cleanup stats (total=3, active=2, idle=1, waiting=0)
   2022-12-07T06:47:25,591 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
After cleanup  stats (total=3, active=2, idle=1, waiting=0)
   2022-12-07T06:47:55,591 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
Before cleanup stats (total=4, active=1, idle=3, waiting=0)
   2022-12-07T06:47:55,592 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
After cleanup  stats (total=4, active=1, idle=3, waiting=0)
   2022-12-07T06:48:25,592 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
Before cleanup stats (total=4, active=1, idle=3, waiting=0)
   2022-12-07T06:48:25,592 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
After cleanup  stats (total=4, active=1, idle=3, waiting=0)
   2022-12-07T06:48:55,593 DEBUG [mutex housekeeper] pool.HikariPool: mutex - 
Before cleanup stats (total=3, active=1, idle=2, waiting=0)
   
   The DBCP has a little bit different from `HikariCP`, though I have set 
`maxIdle` and `timeBetweenEvictionRunsMillis`
   ```java
    objectPool.setMaxIdle(Math.min(maxPoolSize, 2));
    objectPool.setTimeBetweenEvictionRunsMillis(300000);
   ```
   but don't see a drop down of connections when HMS is free.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to