<div dir="ltr">Hi,<div><br></div><div>There's no stickyness involved with the round-robin director. But from what you are describing, Varnish is doing what you ask it to do: it caches from one backend and keep serving the cached content (ie. it doesn't need to go to the backends anymore).</div><div><br></div><div>If you wish to have a non-caching loadbalancer, then then "return (pass);" at the end of vcl_recv and you'll be ok.</div><div><br></div><div>Otherwise, what behavior do you wish to obtain?</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div>Guillaume Quintard<br></div></div></div>
<br><div class="gmail_quote">On Wed, Nov 23, 2016 at 3:59 PM, Sreenath Kodedala <span dir="ltr"><<a href="mailto:vedarad@gmail.com" target="_blank">vedarad@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><a href="http://stackoverflow.com/questions/40751646/varnish-4-to-cache-from-multiple-servers-with-different-content" target="_blank">http://stackoverflow.com/<wbr>questions/40751646/varnish-4-<wbr>to-cache-from-multiple-<wbr>servers-with-different-content</a><wbr> <div><br></div><div><br></div><div><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">Using varnish 4 to cache different content of same request from multiple servers. It looks like it caches the first request from one server and keeps giving the same content for every subsequent request.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">doing curl gives response with two caches and different age.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">Are there any factors like load or anything else for stickiness behaviour? Used Jmeter and apache benchmark with load but still got the same behaviour.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">Is my vcl_hash is good? Want to save the object with hash combination of url and ip of backend server.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">am I missing anything?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:arial,"helvetica neue",helvetica,sans-serif">using round robin and hash_data. below is my config.vcl</p><pre style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;background-color:rgb(239,240,241);word-wrap:normal;color:rgb(36,39,41)"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit">backend s1{
    .host = "190.120.90.1";
}

backend s2{
    .host = "190.120.90.2";
}

sub vcl_init {
    new vms = directors.round_robin();
    vms.add_backend(s1);
    vms.add_backend(s2);
}

sub vcl_recv {
    set req.backend_hint = vms.backend();
}

sub vcl_hash {
    hash_data(req.url);
    if (req.http.host) {
        hash_data(req.http.host);
    } else {
        hash_data(server.ip);
    }
    return(lookup);
}</code></pre></div><div><br clear="all"><div><div class="m_7938698339899434459gmail_signature"><div dir="ltr">Thanks,<br>Sreenath</div></div></div>
</div></div>
<br>______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br></blockquote></div><br></div>