- unbound-control stats has mem.streamwait that counts TCP and TLS

waiting result buffers.


git-svn-id: file:///svn/unbound/trunk@5050 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2019-01-22 13:20:06 +00:00
parent 4481b9584c
commit 8b18d1a0a4
6 changed files with 19 additions and 4 deletions

View 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;

View 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);

View 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.

View 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.

View 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;
};
/**

View 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);
}