In message <[email protected]>, 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
[email protected]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to