<br><div>Hi,</div><div><br>I&#39;m experimenting with the nginx upload progress module for a system I&#39;m building.  At some point, I expect I&#39;ll need a cluster of &quot;upload&quot; nodes (currently planning to use the upload and upload progress modules) in order to handle all incoming uploads.  The problem I&#39;m expecting to have w/ the upload progress module is, if I&#39;m running a cluster of nodes w/ a shared IP (and/or behind a load balancer), is how to ensure &quot;progress&quot; requests are routed to the same host as the upload POST, (assuming POSTs always go to the same domain, e.g., <a href="http://uploads.example.com">uploads.example.com</a>).</div>

<div><br></div><div>I&#39;m currently planning to run this system on EC2 and am considering the following options, but thought I&#39;d ask here to see if anyone has solved this problem; has other, better ideas; or might correct my assumptions -- since I don&#39;t particularly like any of these options.</div>

<div><br></div><div>Option 1: use Elastic Load Balancer with session stickiness</div><div>Problem: ELB is time-based so it is possible for the session to &quot;unstick&quot; in the middle of an upload; higher time expiration settings could mitigate (but not prevent) this but work against the load balancers ability to balance traffic</div>

<div><br></div><div>Option 2: Distribute requests amongst nodes using a hash on the X-Progress-ID value and subdomains (e.g., hash ids to a value a-z, map [a-z].<a href="http://uploads.example.com">uploads.example.com</a> evenly across N nodes; always post to the subdomain as a hash of X-Progress-ID)</div>

<div>Problem: Spreads posts evenly, but complicates client logic and can&#39;t easily intelligently balance requests based on current load</div><div><br></div><div>Option 4: Make the app pick a host (client must ask where to POST before POSTing upload)</div>

<div>Problem: pushes load balancing work into the server app &amp; makes the client do more work</div><div><br></div><div>Option 3: RYO load balancer (build (or configure) a custom load balancer that can run on EC2 instances and route requests intelligently)</div>

<meta charset="utf-8"><div>Problem: Seems like overkill</div><div><br></div><div>Anyway -- thanks for any insights/thoughts.</div><div><br>Scott</div>