yuqi1129 commented on PR #13620:
URL: https://github.com/apache/gravitino/pull/13620#issuecomment-6060714677

   @diqiu50 Thanks, agreed on the mechanism. The churn comes from 
`returnObject`, not from idle-time eviction: commons-pool2 2.12.0 
`GenericObjectPool.returnObject` destroys a returned connection when `maxIdle 
<= idleObjects.size()`. With `maxIdle = 10`, every connection returned beyond 
the tenth idle one was closed, and the next borrow opened a new physical 
connection. The evictor (at most 3 connections every 10 minutes) cannot explain 
the churn; the doc note about it is only about how long retained idle 
connections stay open, i.e. the connection budget.
   
   `maxIdle` is exactly the threshold `returnObject` checks, which is why the 
A/B in #13582, where only that constant changed from 10 to 100, went from about 
3,400 to 4–36 physical connections per window and p99 from 214 ms to 90 ms.
   
   On "by itself": you're right that the default of 32 narrows the churn but 
does not remove it for the measured 64-client workload, since more than 32 
connections can be in use at peak. That workload needs `maxIdleConnections` at 
or above its steady peak concurrency, which this PR makes possible. In 
4acad56929 I made the mechanism explicit in 
`how-to-use-relational-backend-storage.md` and the PR description, so operators 
size the limit that way.
   


-- 
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]

Reply via email to