/** 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
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;
}
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;
}
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);
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.
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.
/** 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;
};
/**
}
/** 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);
PR_LL("mem.cache.dnscrypt_nonce",
shm_stat->mem.dnscrypt_nonce);
#endif
+ PR_LL("mem.streamwait", s->svr.mem_stream_wait);
}
/** print histogram */
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);
}