<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-family: monospace; "><div>"""<br>So I also vote for keeping this as a documented configuration rather<br>than a built-in feature. Unless the planned sticky load balancing will<br>have something above the rudimentary.</div><div>"""</div><div><br></div><div>i understand varnish is a fast reverse proxy/httpaccelerator not an uber-does-it-all service. but, for many implementations we don't want to stack 3-4 services on top of each other. </div><div>would having this as a documented config easily solve the problem of sticky load balancing, without a lot of poking around and configuration? </div><div><br></div><div>(note: i found the default vanilla implementation only working well for images; other pages without the most rudimentary caching config failed to work correctly for me due to two reasons: ignorance, stupidity. In other words, the Vary headers stung me as browser to browser caused different objects to be cached and the default purge implementation could not reach all objects easily)</div><div><br></div><div>finally, per adding this config to MY config. how do you do that? That is, i don't want to just copy and paste this vcl snippet into my main varnish.vcl. Is there a way to include vcls from vcls?</div><div><br></div><div>Thanks,</div><div><br></div><div>Rob</div><div><br></div><div><br></div>Date: Wed, 14 Apr 2010 14:28:11 +0200<br>From: Niklas Norberg <<a href="mailto:niklas.norberg@bahnhof.se">niklas.norberg@bahnhof.se</a>><br>To: <a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>Subject: Sticky Load Balancing with Varnish<br>Message-ID: <<a href="mailto:1271248091.5141.33.camel@app-srv-debian-amdmp2.idni">1271248091.5141.33.camel@app-srv-debian-amdmp2.idni</a>><br>Content-Type: text/plain; charset="us-ascii"<br><br>Hi,<br><br>last week I started writing a sticky load balancer.<br><br>At that time (2.0.6) I lacked that req.* wasn't available in vcl_deliver<br>so I had to use some global C-variables to share data from vcl_recv to<br>vcl_deliver. Because of this I had to add some thread guard C-code and<br>all together it worked but I wasn't fully satisfied. The guard code<br>contained sleep in order to wait for other thread so that just one<br>thread at a time would go through this "set/get" cycle.<br><br>This week I discovered that 2.1.0 was released and that:<br>- req.* is now available in vcl_deliver.<br><br>So I rewrote it, just by removing the thread C-code, and here it is.<br>I've tested it with JMeter and it balances correct (i.e. according to<br>the defined weights).<br><br>So I also vote for keeping this as a documented configuration rather<br>than a built-in feature. Unless the planned sticky load balancing will<br>have something above the rudimentary.<br><br>Comments?<br><br><br>With kind regards,<br><br>Niklas Norberg<br></span></body></html>