Commit 7bf932f3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Rename the esi_iovs paramter to http1_iovs and default it to 64

which is half the wrk-aws it comes from.

This saves us from peeking into the VDP stack to spot ESI modules.
parent da8b6dc0
...@@ -84,7 +84,7 @@ v1d_error(struct req *req, const char *msg) ...@@ -84,7 +84,7 @@ v1d_error(struct req *req, const char *msg)
void v_matchproto_(vtr_deliver_f) void v_matchproto_(vtr_deliver_f)
V1D_Deliver(struct req *req, struct boc *boc, int sendbody) V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
{ {
int err; int err = 0;
unsigned u; unsigned u;
uint64_t hdrbytes, bytes; uint64_t hdrbytes, bytes;
...@@ -131,7 +131,7 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody) ...@@ -131,7 +131,7 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
AZ(req->wrk->v1l); AZ(req->wrk->v1l);
V1L_Open(req->wrk, req->wrk->aws, V1L_Open(req->wrk, req->wrk->aws,
&req->sp->fd, req->vsl, req->t_prev, 0); &req->sp->fd, req->vsl, req->t_prev, cache_param->http1_iovs);
if (WS_Overflowed(req->wrk->aws)) { if (WS_Overflowed(req->wrk->aws)) {
v1d_error(req, "workspace_thread overflow"); v1d_error(req, "workspace_thread overflow");
...@@ -141,47 +141,18 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody) ...@@ -141,47 +141,18 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
hdrbytes = HTTP1_Write(req->wrk, req->resp, HTTP1_Resp); hdrbytes = HTTP1_Write(req->wrk, req->resp, HTTP1_Resp);
if (!sendbody || req->res_mode & RES_ESI) { if (sendbody) {
if (V1L_Close(req->wrk, &bytes) && req->sp->fd >= 0) { if (DO_DEBUG(DBG_FLUSH_HEAD))
Req_Fail(req, SC_REM_CLOSE);
sendbody = 0;
}
/* Charge bytes sent as reported from V1L_Close. Only
* header-bytes have been attempted sent. */
req->acct.resp_hdrbytes += bytes;
hdrbytes = 0;
} else if (DO_DEBUG(DBG_FLUSH_HEAD))
(void)V1L_Flush(req->wrk); (void)V1L_Flush(req->wrk);
if (!sendbody) {
AZ(req->wrk->v1l);
VDP_close(req);
return;
}
AN(sendbody);
if (req->res_mode & RES_ESI) {
AZ(req->wrk->v1l);
V1L_Open(req->wrk, req->wrk->aws,
&req->sp->fd, req->vsl, req->t_prev,
cache_param->esi_iovs);
if (WS_Overflowed(req->wrk->aws)) {
v1d_error(req, "workspace_thread overflow");
AZ(req->wrk->v1l);
return;
}
}
if (req->res_mode & RES_CHUNKED) if (req->res_mode & RES_CHUNKED)
V1L_Chunked(req->wrk); V1L_Chunked(req->wrk);
err = VDP_DeliverObj(req); err = VDP_DeliverObj(req);
if (!err && (req->res_mode & RES_CHUNKED)) if (!err && (req->res_mode & RES_CHUNKED))
V1L_EndChunk(req->wrk); V1L_EndChunk(req->wrk);
}
u = V1L_Close(req->wrk, &bytes); u = V1L_Close(req->wrk, &bytes);
AZ(req->wrk->v1l);
/* Bytes accounting */ /* Bytes accounting */
if (bytes < hdrbytes) if (bytes < hdrbytes)
...@@ -193,6 +164,5 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody) ...@@ -193,6 +164,5 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
if ((u || err) && req->sp->fd >= 0) if ((u || err) && req->sp->fd >= 0)
Req_Fail(req, SC_REM_CLOSE); Req_Fail(req, SC_REM_CLOSE);
AZ(req->wrk->v1l);
VDP_close(req); VDP_close(req);
} }
...@@ -123,7 +123,7 @@ taken from :ref:`ref_param_workspace_client`. If you need to reduce ...@@ -123,7 +123,7 @@ taken from :ref:`ref_param_workspace_client`. If you need to reduce
memory footprint, consider reducing ``workspace_client`` by the amount memory footprint, consider reducing ``workspace_client`` by the amount
in ``workspace_thread``. in ``workspace_thread``.
Added :ref:`ref_param_esi_iovs`. tl;dr: Don't touch it, unless advised Added `ref_param_esi_iovs`. tl;dr: Don't touch it, unless advised
to do so by someone familiar with the innards of Varnish. to do so by someone familiar with the innards of Varnish.
Changes to VCL Changes to VCL
......
...@@ -498,16 +498,17 @@ PARAM( ...@@ -498,16 +498,17 @@ PARAM(
) )
PARAM( PARAM(
/* name */ esi_iovs, /* name */ http1_iovs,
/* typ */ uint, /* typ */ uint,
/* min */ "3", /* min */ "5",
/* max */ "1024", // XXX stringify IOV_MAX /* max */ "1024", // XXX stringify IOV_MAX
/* default */ "10", // 5 should suffice, add headroom /* default */ "64",
/* units */ "struct iovec", /* units */ "struct iovec (=16 bytes)",
/* flags */ WIZARD, /* flags */ WIZARD,
/* s-text */ /* s-text */
"Number of io vectors to allocate on the thread workspace for " "Number of io vectors to allocate for HTTP1 protocol transmission."
"ESI requests.", " A HTTP1 header needs 7 + 2 per HTTP header field."
" Allocated from workspace_thread.",
/* l-text */ "", /* l-text */ "",
/* func */ NULL /* func */ NULL
) )
......
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