Closed hkrutzer closed 4 years ago
I think polling to see if it is idle or not will be ultimately imprecise. Perhaps it is better to measure the time since last check-in and emit those as part of the existing telemetry events as idle time.
So the idea is, as soon you as checkin, you get the current time, then when you checkout and we are logging, you get the current time and emit the difference as idle time.
Closing in favor of #210.
You are very quick :) I don't know if current active connections would be too imprecise but your approach will definitely be more precise. Thanks!
So when rethinking this... If I have 100 connections and 20 are idle at all times, so I can safely lower the connection count by at least 15, I still have to lower the count by trial and error after adding the idle_time
statistic.
We have telemetry for queue time which is very helpful, and we can increase the size of the connection pool based on this data. However, decreasing the amount of connections is still trial-and-error. It would be nice if there was a way to see how many connections are idle at a given time. We can then poll this every second or so, and be more confident about changing the pool size.