of names that have been inserted into the cache. The number of cache hits and
misses and the number of authoritative queries answered are also given. For each upstream
server it gives the number of queries sent, and the number which
-resulted in an error. In
+resulted in an error. It also gives information on the number of forks for TCP connections. In
.B --no-daemon
mode or when full logging is enabled (\fB--log-queries\fP), a complete dump of the
contents of the cache is made.
#endif
blockdata_report();
-
+ my_syslog(LOG_INFO, _("child processes for TCP requests: in use %zu, highest since last SIGUSR1 %zu, max allowed %zu."),
+ daemon->metrics[METRIC_TCP_CONNECTIONS],
+ daemon->max_procs_used,
+ daemon->max_procs);
+ daemon->max_procs_used = daemon->metrics[METRIC_TCP_CONNECTIONS];
+
/* sum counts from different records for same server */
for (serv = daemon->servers; serv; serv = serv->next)
serv->flags &= ~SERV_MARK;
else if (daemon->port != 0)
for (i = 0 ; i < daemon->max_procs; i++)
if (daemon->tcp_pids[i] == p)
- daemon->tcp_pids[i] = 0;
+ {
+ daemon->tcp_pids[i] = 0;
+ /* tcp_pipes == -1 && tcp_pids == 0 required to free slot */
+ if (daemon->tcp_pipes[i] == -1)
+ daemon->metrics[METRIC_TCP_CONNECTIONS]--;
+ }
break;
#if defined(HAVE_SCRIPT)
{
close(daemon->tcp_pipes[i]);
daemon->tcp_pipes[i] = -1;
+ /* tcp_pipes == -1 && tcp_pids == 0 required to free slot */
+ if (daemon->tcp_pids[i] == 0)
+ daemon->metrics[METRIC_TCP_CONNECTIONS]--;
}
for (listener = daemon->listeners; listener; listener = listener->next)
/* i holds index of free slot */
daemon->tcp_pids[i] = p;
daemon->tcp_pipes[i] = pipefd[0];
+ daemon->metrics[METRIC_TCP_CONNECTIONS]++;
+ if (daemon->metrics[METRIC_TCP_CONNECTIONS] > daemon->max_procs_used)
+ daemon->max_procs_used = daemon->metrics[METRIC_TCP_CONNECTIONS];
}
close(confd);
int dumpfd;
#endif
int max_procs;
+ uint max_procs_used;
} *daemon;
struct server_details {
"leases_pruned_4",
"leases_allocated_6",
"leases_pruned_6",
+ "tcp_connections",
};
const char* get_metric_name(int i) {
METRIC_LEASES_PRUNED_4,
METRIC_LEASES_ALLOCATED_6,
METRIC_LEASES_PRUNED_6,
+ METRIC_TCP_CONNECTIONS,
__METRIC_MAX,
};
daemon->randport_limit = 1;
daemon->host_index = SRC_AH;
daemon->max_procs = MAX_PROCS;
+ daemon->max_procs_used = 0;
/* See comment above make_servers(). Optimises server-read code. */
mark_servers(0);