Skip to content

Expose the TCP client count in statistics channel

Track the number of TCP IPv4/IPv6 clients as netmgr statistics independent from tcpquota.

I both have tried to bolt on isc_quota_getused to statschannel and a callback based quota release but it kept being costly and a bit of a mess just like predicted in #4425 (closed).

I made it so the client stats are bump when the accept is successful and decrease when the quota is also released in the close callback so its not always equal to the quota usage. When a client fails to connect, it still occupies the quota just before cleanup but it won't counted as a client connection.

It shouldn't make much of a difference except when there is a constant churn of client failures. Then, there would be a lot of failed connections and few active clients from the eyes of statistics channel but rndc stats would show high client utilization.

Because of this, moving the counter bump near the quota code would be okay as well.

Closes #4425 (closed)

Merge request reports