Commit 4670e054 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a couple of counters to keep track of how many requests

are on the busy-obj waitinglists
parent e7d5afec
...@@ -424,6 +424,8 @@ HSH_Lookup(struct req *req) ...@@ -424,6 +424,8 @@ HSH_Lookup(struct req *req)
if (cache_param->diag_bitmap & 0x20) if (cache_param->diag_bitmap & 0x20)
VSLb(req->vsl, SLT_Debug, VSLb(req->vsl, SLT_Debug,
"on waiting list <%p>", oh); "on waiting list <%p>", oh);
wrk->stats.busy_sleep++;
SES_Charge(req->wrk, req); SES_Charge(req->wrk, req);
/* /*
* The objhead reference transfers to the sess, we get it * The objhead reference transfers to the sess, we get it
...@@ -480,6 +482,7 @@ hsh_rush(struct dstat *ds, struct objhead *oh) ...@@ -480,6 +482,7 @@ hsh_rush(struct dstat *ds, struct objhead *oh)
if (req == NULL) if (req == NULL)
break; break;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
ds->busy_wakeup++;
AZ(req->wrk); AZ(req->wrk);
VTAILQ_REMOVE(&wl->list, req, w_list); VTAILQ_REMOVE(&wl->list, req, w_list);
DSL(0x20, SLT_Debug, req->sp->vsl_id, "off waiting list"); DSL(0x20, SLT_Debug, req->sp->vsl_id, "off waiting list");
......
...@@ -33,3 +33,6 @@ client c2 { ...@@ -33,3 +33,6 @@ client c2 {
} -run } -run
client c1 -wait client c1 -wait
varnish v1 -expect busy_sleep == 1
varnish v1 -expect busy_wakeup == 1
...@@ -249,6 +249,18 @@ VSC_F(thread_queue_len, uint64_t, 0, 'g', ...@@ -249,6 +249,18 @@ VSC_F(thread_queue_len, uint64_t, 0, 'g',
" See also param queue_max." " See also param queue_max."
) )
VSC_F(busy_sleep, uint64_t, 1, 'c',
"Number of requests sent to sleep on busy objhdr",
"Number of requests sent to sleep without a worker threads because"
" they found a busy object."
)
VSC_F(busy_wakeup, uint64_t, 1, 'c',
"Number of requests woken after sleep on busy objhdr",
"Number of requests taken of the busy object sleep list and"
" and rescheduled."
)
VSC_F(sess_queued, uint64_t, 0, 'c', VSC_F(sess_queued, uint64_t, 0, 'c',
"Sessions queued for thread", "Sessions queued for thread",
"Number of times session was queued waiting for a thread." "Number of times session was queued waiting for a thread."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment