title: Database query load balancing
body: <p>I have several instances of an application running the same query against several SQL Server databases. There is a manual load balancing mechanism in place: each instance uses an algorithm to asimmetrically decide which server to query at a given time.</p>
  
  <p>The processing time of the query, and thus the resource consumption on the server, varies greatly depending on the input parameters, which are different each time that the queries are fired.</p>
  
  <p>The current implementation of the balancing algorithm causes, from time to time, one of the severs ending up as the target of several "long/heavy" queries, while the other servers are left underused. </p>
  
  <p>As I know beforehand if a query is a heavy one, how could I improve the algorithm to prevent that server overload?</p>
  
  <p>Right now each application instance decides how to do the balancing independently of each other, so I guess I should share the load information between all instances, right?</p>
  
  <p>Thanks!</p>