]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- unbound-control stats has mem.streamwait that counts TCP and TLS
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 22 Jan 2019 13:20:06 +0000 (13:20 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 22 Jan 2019 13:20:06 +0000 (13:20 +0000)
  waiting result buffers.

git-svn-id: file:///svn/unbound/trunk@5050 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/remote.c
daemon/stats.c
doc/Changelog
doc/unbound-control.8.in
libunbound/unbound.h
smallapp/unbound-control.c

index 2c3e7ce5b1f0300a17d39fc080f78883009336a3..b25cf1798407484d999b37b92cad13f49f1a0c66 100644 (file)
@@ -789,7 +789,8 @@ print_longnum(RES* ssl, const char* desc, size_t x)
 
 /** print mem stats */
 static int
-print_mem(RES* ssl, struct worker* worker, struct daemon* daemon)
+print_mem(RES* ssl, struct worker* worker, struct daemon* daemon,
+       struct ub_stats_info* s)
 {
        size_t msg, rrset, val, iter, respip;
 #ifdef CLIENT_SUBNET
@@ -847,6 +848,9 @@ print_mem(RES* ssl, struct worker* worker, struct daemon* daemon)
                        dnscrypt_nonce))
                return 0;
 #endif /* USE_DNSCRYPT */
+       if(!print_longnum(ssl, "mem.streamwait"SQ,
+               (size_t)s->svr.mem_stream_wait))
+               return 0;
        return 1;
 }
 
@@ -1088,7 +1092,7 @@ do_stats(RES* ssl, struct daemon_remote* rc, int reset)
        if(!print_uptime(ssl, rc->worker, reset))
                return;
        if(daemon->cfg->stat_extended) {
-               if(!print_mem(ssl, rc->worker, daemon)) 
+               if(!print_mem(ssl, rc->worker, daemon, &total)) 
                        return;
                if(!print_hist(ssl, &total))
                        return;
index cff01d90342fcc022b0524f82d17fec959a0e017..9a4afff4bab4bf7e7b5df237082004b74759c6bd 100644 (file)
@@ -328,6 +328,7 @@ server_stats_compile(struct worker* worker, struct ub_stats_info* s, int reset)
                }
                lock_rw_unlock(&worker->env.auth_zones->lock);
        }
+       s->svr.mem_stream_wait = tcp_req_info_get_stream_buffer_size();
 
        /* Set neg cache usage numbers */
        set_neg_cache_stats(worker, &s->svr, reset);
index 81a4edcbbf6ec4ecb8b7f6e92964e414c60dcd7c..152e6011b29af25d57f2d359b8c90513a8ea284a 100644 (file)
@@ -1,6 +1,8 @@
 22 January 2018: Wouter
        - Fix space calculation for tcp req buffer size.
        - Doc for stream-wait-size and unit test.
+       - unbound-control stats has mem.streamwait that counts TCP and TLS
+         waiting result buffers.
 
 21 January 2018: Wouter
        - Fix tcp idle timeout test, for difference in the tcp reply code.
index da042c816d0fcf4c74881dd33005a750b94b3b05..f5944a75f0c5c25809272915d4ce52acd0ba906d 100644 (file)
@@ -499,6 +499,10 @@ Memory in bytes in use by the iterator module.
 Memory in bytes in use by the validator module. Includes the key cache and
 negative cache.
 .TP
+.I mem.streamwait
+Memory in bytes in used by the TCP and TLS stream wait buffers.  These are
+answers waiting to be written back to the clients.
+.TP
 .I histogram.<sec>.<usec>.to.<sec>.<usec>
 Shows a histogram, summed over all threads. Every element counts the
 recursive queries whose reply time fit between the lower and upper bound.
index 90766b0623636e95482a958f027777804aae4315..3fa5b13dec71e2b7dc616733fd50ef8f1ad1a531 100644 (file)
@@ -770,6 +770,8 @@ struct ub_server_stats {
        /** number of queries answered from edns-subnet specific data, and
         * the answer was from the edns-subnet cache. */
        long long num_query_subnet_cache;
+       /** number of bytes in the stream wait buffers */
+       long long mem_stream_wait;
 };
 
 /** 
index b947198ef0a797f2c5f616ccb06858843bc643a4..dd00e4940945ae7aa9ddfe18e3cbb0e4d0058346 100644 (file)
@@ -247,7 +247,8 @@ static void print_uptime(struct ub_shm_stat_info* shm_stat)
 }
 
 /** print memory usage */
-static void print_mem(struct ub_shm_stat_info* shm_stat)
+static void print_mem(struct ub_shm_stat_info* shm_stat,
+       struct ub_stats_info* s)
 {
        PR_LL("mem.cache.rrset", shm_stat->mem.rrset);
        PR_LL("mem.cache.message", shm_stat->mem.msg);
@@ -266,6 +267,7 @@ static void print_mem(struct ub_shm_stat_info* shm_stat)
        PR_LL("mem.cache.dnscrypt_nonce",
                shm_stat->mem.dnscrypt_nonce);
 #endif
+       PR_LL("mem.streamwait", s->svr.mem_stream_wait);
 }
 
 /** print histogram */
@@ -399,7 +401,7 @@ static void do_stats_shm(struct config_file* cfg, struct ub_stats_info* stats,
        pr_stats("total", &stats[0]);
        print_uptime(shm_stat);
        if(cfg->stat_extended) {
-               print_mem(shm_stat);
+               print_mem(shm_stat, &stats[0]);
                print_hist(stats);
                print_extended(stats);
        }