From: Wouter Wijngaards Date: Thu, 10 Apr 2014 09:13:58 +0000 (+0000) Subject: - unbound-control stats prints num.query.tcpout with number of TCP X-Git-Tag: release-1.5.0rc1~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=330b3219a057e0cec1045ef40aa15074e0795d65;p=thirdparty%2Funbound.git - unbound-control stats prints num.query.tcpout with number of TCP outgoing queries made in the previous statistics interval. git-svn-id: file:///svn/unbound/trunk@3108 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/contrib/unbound_munin_ b/contrib/unbound_munin_ index 5c047323c..6ca4902b9 100755 --- a/contrib/unbound_munin_ +++ b/contrib/unbound_munin_ @@ -238,6 +238,7 @@ if test "$1" = "config" ; then p_config "total.num.cachehits" "cache hits" p_config "total.num.prefetch" "cache prefetch" p_config "num.query.tcp" "TCP queries" + p_config "num.query.tcpout" "TCP out queries" p_config "num.query.ipv6" "IPv6 queries" p_config "unwanted.queries" "queries that failed acl" p_config "unwanted.replies" "unwanted or unsolicited replies" @@ -425,7 +426,8 @@ hits) for x in `grep "^thread[0-9][0-9]*\.num\.queries=" $state | sed -e 's/=.*//'` total.num.queries \ total.num.cachehits total.num.prefetch num.query.tcp \ - num.query.ipv6 unwanted.queries unwanted.replies; do + num.query.tcpout num.query.ipv6 unwanted.queries \ + unwanted.replies; do if grep "^"$x"=" $state >/dev/null 2>&1; then print_qps $x fi diff --git a/daemon/remote.c b/daemon/remote.c index 9ff40325f..93f1862a5 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -821,6 +821,8 @@ print_ext(SSL* ssl, struct stats_info* s) /* transport */ if(!ssl_printf(ssl, "num.query.tcp"SQ"%u\n", (unsigned)s->svr.qtcp)) return 0; + if(!ssl_printf(ssl, "num.query.tcpout"SQ"%u\n", + (unsigned)s->svr.qtcp_outgoing)) return 0; if(!ssl_printf(ssl, "num.query.ipv6"SQ"%u\n", (unsigned)s->svr.qipv6)) return 0; /* flags */ diff --git a/daemon/stats.c b/daemon/stats.c index 57ad1ef6b..6abbfefca 100644 --- a/daemon/stats.c +++ b/daemon/stats.c @@ -158,6 +158,7 @@ server_stats_compile(struct worker* worker, struct stats_info* s, int reset) NUM_BUCKETS_HIST); /* values from outside network */ s->svr.unwanted_replies = worker->back->unwanted_replies; + s->svr.qtcp_outgoing = worker->back->num_tcp_outgoing; /* get and reset validator rrset bogus number */ s->svr.rrset_bogus = get_rrset_bogus(worker); @@ -217,6 +218,7 @@ void server_stats_add(struct stats_info* total, struct stats_info* a) total->svr.qtype_big += a->svr.qtype_big; total->svr.qclass_big += a->svr.qclass_big; total->svr.qtcp += a->svr.qtcp; + total->svr.qtcp_outgoing += a->svr.qtcp_outgoing; total->svr.qipv6 += a->svr.qipv6; total->svr.qbit_QR += a->svr.qbit_QR; total->svr.qbit_AA += a->svr.qbit_AA; diff --git a/daemon/stats.h b/daemon/stats.h index 7c315513f..92487b8b6 100644 --- a/daemon/stats.h +++ b/daemon/stats.h @@ -91,6 +91,8 @@ struct server_stats { size_t qopcode[STATS_OPCODE_NUM]; /** number of queries over TCP */ size_t qtcp; + /** number of outgoing queries over TCP */ + size_t qtcp_outgoing; /** number of queries over IPv6 */ size_t qipv6; /** number of queries with QR bit */ diff --git a/daemon/worker.c b/daemon/worker.c index 67cd427b6..89929d4fb 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -1324,6 +1324,7 @@ void worker_stats_clear(struct worker* worker) server_stats_init(&worker->stats, worker->env.cfg); mesh_stats_clear(worker->env.mesh); worker->back->unwanted_replies = 0; + worker->back->num_tcp_outgoing = 0; } void worker_start_accept(void* arg) diff --git a/doc/Changelog b/doc/Changelog index 8fda4c683..a8e99a077 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,9 @@ - iana portlist updated. - Patch from Hannes Frederic Sowa for Linux 3.15 fragmentation option for DNS fragmentation defense. + - Document that dump_requestlist only prints queries from thread 0. + - unbound-control stats prints num.query.tcpout with number of TCP + outgoing queries made in the previous statistics interval. 8 April 2014: Wouter - Fix #574: make test fails on Ubuntu 14.04. Disabled remote-control diff --git a/doc/unbound-control.8.in b/doc/unbound-control.8.in index 3a9abfc22..a40895cb5 100644 --- a/doc/unbound-control.8.in +++ b/doc/unbound-control.8.in @@ -147,6 +147,8 @@ such as a higher verbosity level. Show what is worked on. Prints all queries that the server is currently working on. Prints the time that users have been waiting. For internal requests, no time is printed. And then prints out the module status. +This prints the queries from the first thread, and not queries that are +being serviced from other threads. .TP .B flush_infra \fIall|IP If all then entire infra cache is emptied. If a specific IP address, the @@ -401,6 +403,10 @@ Also printed for other opcodes, UPDATE, ... .I num.query.tcp Number of queries that were made using TCP towards the unbound server. .TP +.I num.query.tcpout +Number of queries that the unbound server made using TCP outgoing towards +other servers. +.TP .I num.query.ipv6 Number of queries that were made using IPv6 towards the unbound server. .TP diff --git a/services/outside_network.c b/services/outside_network.c index fedbd0fa8..3b685804f 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -258,6 +258,7 @@ outnet_tcp_take_into_use(struct waiting_tcp* w, uint8_t* pkt, size_t pkt_len) w->pkt = NULL; w->next_waiting = (void*)pend; pend->id = LDNS_ID_WIRE(pkt); + w->outnet->num_tcp_outgoing++; w->outnet->tcp_free = pend->next_free; pend->next_free = NULL; pend->query = w; @@ -600,6 +601,7 @@ outside_network_create(struct comm_base *base, size_t bufsize, comm_base_timept(base, &outnet->now_secs, &outnet->now_tv); outnet->base = base; outnet->num_tcp = num_tcp; + outnet->num_tcp_outgoing = 0; outnet->infra = infra; outnet->rnd = rnd; outnet->sslctx = sslctx; diff --git a/services/outside_network.h b/services/outside_network.h index dda9d6f5a..a56a205c3 100644 --- a/services/outside_network.h +++ b/services/outside_network.h @@ -135,6 +135,8 @@ struct outside_network { struct pending_tcp **tcp_conns; /** number of tcp communication points. */ size_t num_tcp; + /** number of tcp communication points in use. */ + size_t num_tcp_outgoing; /** list of tcp comm points that are free for use */ struct pending_tcp* tcp_free; /** list of tcp queries waiting for a buffer */