[PATCH] Add the VSL tag BereqEnd

Poul-Henning Kamp phk at phk.freebsd.dk
Wed Oct 23 14:33:59 CEST 2013


In message <525E70DE.8010507 at uplex.de>, Geoff Simmons writes:

>> dTreq: time to send the backend request

This one probably does not do what you think.

>+	bo->t_send = VTIM_mono();
> 	(void)HTTP1_Write(wrk, hp, 0);	/* XXX: stats ? */
> 
> 	/* Deal with any message-body the request might (still) have */
>@@ -241,6 +243,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo,
> struct req *req)
> 		if (req->req_body_status == REQ_BODY_DONE)
> 			retry = -1;
> 	}
>+	bo->t_sent = VTIM_mono();
> 
> 	if (WRW_FlushRelease(wrk) || i != 0) {
> 		VSLb(bo->vsl, SLT_FetchError, "backend write error: %d (%s)",

The writev() to the kernel doesn't happen until WRW_FlushRelease(), so
at the very least the timestamp should be taken after that.

But...

The time you measure is only the time to hand the request to the kernels
network stack.  As far as I know, there is no way to wait on a socket
until all queued data has been sent (or even ACKed).

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list