<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">OK.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"> I run a go server, such as:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><div id="bloop_customfont" style="margin: 0px;">func handler(res http.ResponseWriter, req *http.Request) {</div><div id="bloop_customfont" style="margin: 0px;">        atomic.AddUint32(&times, 1)</div><div id="bloop_customfont" style="margin: 0px;">        number := rand.Intn(100)</div><div id="bloop_customfont" style="margin: 0px;">        fmt.Printf("Random number: %d.\n", number)</div><div id="bloop_customfont" style="margin: 0px;">        t := atomic.LoadUint32(&times)</div><div id="bloop_customfont" style="margin: 0px;">        if t%4 == 1 {</div><div id="bloop_customfont" style="margin: 0px;">                time.Sleep(7 * time.Second)</div><div id="bloop_customfont" style="margin: 0px;">        }</div><div id="bloop_customfont" style="margin: 0px;">        fmt.Fprintf(res, "Random number: %d.\n", number)</div><div id="bloop_customfont" style="margin: 0px;">        fmt.Println("=========================")</div><div id="bloop_customfont" style="margin: 0px;">}</div><div><br></div><div><br></div><div>I use this as varnish backend, and setting hash_always_miss</div><div>so I curl 127.0.0.1:8000 for 5 times.</div><div><br></div><div>curl 127.0.0.1:8000  0.00s user 0.00s system 0% cpu 2 total</div><div>curl 127.0.0.1:8000  0.00s user 0.00s system 77% cpu 0.005 total</div><div>curl 127.0.0.1:8000  0.00s user 0.00s system 66% cpu 0.005 total</div><div>curl 127.0.0.1:8000  0.00s user 0.00s system 68% cpu 0.004 total</div><div>curl 127.0.0.1:8000  0.00s user 0.00s system 0% cpu 7.005 total </div><div><br></div><div>I think the fifth requet's time usage is 2s, but It's 7s. How can I set varnish to make it be 2s</div></div> <br><p class="airmail_on">On 28 December 2016 at 18:19:21, Boukelmoune Dridi (<a href="mailto:dridi@varni.sh">dridi@varni.sh</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>On Wed, Dec 28, 2016 at 10:24 AM, Andreas Plesner <apj@mutt.dk> wrote:
<br>> On Wed, Dec 28, 2016 at 05:12:54PM +0800, JackDrogon wrote:
<br>>
<br>>>       I set varnish backend that:
<br>>>       backend default { .host = "127.0.0.1"; .port = "4567"; .connect_timeout
<br>>>       = 1s; .first_byte_timeout = 2s; .between_bytes_timeout = 1s; }
<br>>>       The first timeout is right, but if the prev connection is right,
<br>>>       varnish use keepalive to deal with the next connection with same url
<br>>>       and the timeout conf doesn't wok.
<br>>
<br>> Please elaborate. Describe the situation that doesn't work as you expect, and what you would expect to happen.
<br>
<br>Possibly a known problem [1] for first_byte_timeout, apparently still
<br>an open issue.
<br>
<br>Dridi
<br>
<br>[1] https://github.com/varnishcache/varnish-cache/issues/1772
<br>
<br>_______________________________________________
<br>varnish-misc mailing list
<br>varnish-misc@varnish-cache.org
<br>https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
<br></div></div></span></blockquote></body></html>