Commit ff31e8af authored by Dag Haavi Finstad's avatar Dag Haavi Finstad

Add client_resp_500 counter

Counts the number of times we failed a response due to running out of
workspace during delivery.
parent 71c443fa
......@@ -586,6 +586,14 @@
Number of session closes with Error VCL_FAILURE (VCL failure)
.. varnish_vsc:: client_resp_500
:level: diag
:group: wrk
:oneliner: Delivery failed due to insufficient workspace.
Number of times we failed a response due to running out of
workspace memory during delivery.
.. varnish_vsc:: shm_records
:level: diag
:oneliner: SHM records
......
......@@ -73,6 +73,7 @@ v1d_error(struct req *req, const char *msg)
VSLb(req->vsl, SLT_RespStatus, "500");
VSLb(req->vsl, SLT_RespReason, "Internal Server Error");
req->wrk->stats->client_resp_500++;
(void)write(req->sp->fd, r_500, sizeof r_500 - 1);
req->doclose = SC_TX_EOF;
}
......
......@@ -274,7 +274,11 @@ h2_deliver(struct req *req, struct boc *boc, int sendbody)
}
if (VSB_finish(&resp)) {
// We ran out of workspace, return minimal 500
// XXX: VSC counter ?
VSLb(req->vsl, SLT_Error, "workspace_client overflow");
VSLb(req->vsl, SLT_RespStatus, "500");
VSLb(req->vsl, SLT_RespReason, "Internal Server Error");
req->wrk->stats->client_resp_500++;
r = (const char*)h2_500_resp;
sz = sizeof h2_500_resp;
sendbody = 0;
......
......@@ -67,3 +67,5 @@ client c1 {
} -run
logexpect l2 -wait
varnish v1 -expect client_resp_500 == 1
......@@ -46,3 +46,5 @@ client c2 {
expect resp.http.x-of == <undef>
} -run
varnish v1 -expect client_resp_500 == 2
......@@ -28,3 +28,4 @@ client c1 {
} -run
logexpect l1 -wait
varnish v1 -expect client_resp_500 == 1
......@@ -27,3 +27,5 @@ client c1 {
expect resp.http.server == "Varnish"
} -run
} -run
varnish v1 -expect client_resp_500 == 1
......@@ -164,3 +164,5 @@ client c1 {
expect resp.status >= 500
expect resp.status <= 503
} -run
varnish v1 -expect client_resp_500 == 1
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