Commit ee592139 authored by Diego dos Santos Fronza's avatar Diego dos Santos Fronza Committed by Ondřej Surý

Added TCP high-water statistics variable

This variable will report the maximum number of simultaneous tcp clients
that BIND has served while running.

It can be verified by running rndc status, then inspect "tcp high-water:
count", or by generating statistics file, rndc stats, then inspect the
line with "TCP connection high-water" text.

The tcp-highwater variable is atomically updated based on an existing
tcp-quota system handled in ns/client.c.

(cherry picked from commit 66fe8627)
parent e0d1bc74
......@@ -3507,7 +3507,6 @@ client_accept(ns_client_t *client) {
isc_result_t result;
* Set up a new TCP connection. This means try to attach to the
* TCP client quota (tcp-clients), but fail if we're over quota.
......@@ -3558,6 +3557,12 @@ client_accept(ns_client_t *client) {
/* TCP high-water stats update. */
unsigned int curr_tcpquota = isc_quota_getused(&client->sctx->tcpquota);
* If this client was set up using get_client() or get_worker(),
* then TCP is already marked active. However, if it was restarted
......@@ -220,7 +220,9 @@ enum {
dns_nsstatscounter_keytagopt = 56,
dns_nsstatscounter_max = 57
dns_nsstatscounter_tcphighwater = 57,
dns_nsstatscounter_max = 58
......@@ -10880,6 +10880,11 @@ ns_server_status(ns_server_t *server, isc_buffer_t **text) {
server->tcpquota.used, server->tcpquota.max);
CHECK(putstr(text, line));
snprintf(line, sizeof(line), "TCP high-water: %" PRIu64 "\n",
CHECK(putstr(text, line));
CHECK(putstr(text, "server is up and running"));
......@@ -227,6 +227,8 @@ init_desc(void) {
SET_NSSTATDESC(invalidsig, "requests with invalid signature",
SET_NSSTATDESC(requesttcp, "TCP requests received", "ReqTCP");
SET_NSSTATDESC(tcphighwater, "TCP connection high-water",
SET_NSSTATDESC(authrej, "auth queries rejected", "AuthQryRej");
SET_NSSTATDESC(recurserej, "recursive queries rejected", "RecQryRej");
SET_NSSTATDESC(xfrrej, "transfer requests rejected", "XfrRej");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment