<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html><head><meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
<style>BODY{font:10pt Tahoma,Verdana,sans-serif} .MsoNormal{line-height:120%;margin:0}</style></head><body>
<blockquote style="padding-left: 5px; margin-left: 5px; border-left: #0000ff 2px solid; margin-right: 0px"><b>From:</b> Per Buer [mailto:perbu@varnish-software.com]<br><br>Hi,<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 15, 2012 at 3:52 PM, Enno van Amerongen <span><<a href="mailto:enno@tty.nl">enno@tty.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<u></u>

<div>
<div><font face="Tahoma, Verdana, sans-serif">Hi List,</font></div><div><font face="Tahoma, Verdana, sans-serif"><br></font></div><div><font face="Tahoma, Verdana, sans-serif">My coworkers and I are working on a sharding VMOD and we got to the point</font></div>

<div><font face="Tahoma, Verdana, sans-serif">it's actually working (woohoo!).</font></div><div><font face="Tahoma, Verdana, sans-serif"><br></font></div><div><font face="Tahoma, Verdana, sans-serif">Now, our implementation is pretty straightforward:</font></div>

<div><font face="Tahoma, Verdana, sans-serif"><br></font></div><div><font face="Tahoma, Verdana, sans-serif"> - get id from url</font></div><div><font face="Tahoma, Verdana, sans-serif"> - do a "id mod n" to pick correct shard ( = director)</font></div>

<div><font face="Tahoma, Verdana, sans-serif"> - set req.backend = shardN</font></div></div></blockquote><div> </div><div><br></div><div>Any particular reason you didn't use the client director? This is more or less exactly what it does.</div>

<div><br></div><div>You would set client.identity to the ID you pick and Varnish will use a hash algorithm to consistently pick a backend from the backends in the director.<span></span></div></div></div></blockquote><div id="kerio-curpos">yes, we didn't use it because we also need to be able to determine which backend should receive which images. We aren't only sharding the requests, but also the storage.</div><div id="kerio-curpos"><br></div><div id="kerio-curpos">Enno</div><blockquote style="padding-left: 5px; margin-left: 5px; border-left: #0000ff 2px solid; margin-right: 0px"><div class="gmail_extra"><div class="gmail_quote"><div><span></span></div></div></div></blockquote><style>
</style>
</body></html>