Varnish backend timeout doesn't work with keep alive backend

JackDrogon jack.xsuperman at gmail.com
Fri Dec 30 11:10:24 CET 2016


It's so diffcult for me to tracing the timeout problem.




I painted a map of the backend request.
I tracing varnish, found that cache/cache_obj.c:ObjWaitState lock for waiting backend response. But the vwe_thread epoll wait time is not right, it is default time 100s
When epoll_wait is run, it wait for backend response first_bytes_timeout, which in my case is 7s.
If I set cache_waiter_epoll.c:vwe_thread =>  vwe->next = now + 1, all is right. The timeout time became 2s.

I read some varnish code, not full. I want know where is the code that varnish add the backend response header read event to epoll when keepalive is enable.
I guess It's cnt_miss in my case, but I can't see the code, it's in vgc.so. How can see the vgc.so's origin code which is generated by libvcc.

Thanks.

On 29 December 2016 at 16:21:47, Boukelmoune Dridi (dridi at varni.sh) wrote:

On Thu, Dec 29, 2016 at 3:44 AM, JackDrogon <jack.xsuperman at gmail.com> wrote:  
> How to disable backend keep-alive. I want to test it.  

In vcl_backend_fetch, you can do:  

set bereq.http.connection = "close";  

That's how it's specified in HTTP/1.1, by default a connection is persistent.  

Dridi  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20161230/c8d2f426/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2016-12-30 at 14.15.13.png
Type: image/png
Size: 85600 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20161230/c8d2f426/attachment-0001.png>


More information about the varnish-misc mailing list