OP is a friend of mine, and when I first heard of his problem I wondered if there might be an analytical solution to quantify the difference between intelligent vs naive routing. I took this problem as an opportunity to teach myself a bit of Queueing Theory[1], which is a fascinating topic! I'm still very much a beginner, so bear with me and I'd love to get any feedback or suggestions for further study.<p>For this example, let's assume our queueing environment is a grocery store checkout line: our customers enter, line up in order, and are checked out by one or more registers. The basic way to think about these problems is to classify them across three parameters:<p>- arrival time: do customers enter the line in a way that is <i>D</i>eterministic (events happen over fixed intervals), rando<i>M</i> (events are distributed exponentially and described by Poisson process), or <i>G</i>eneral (events fall from an arbitrary probability distribution)?<p>- checkout time: same question for customers getting checked out, is that process <i>D</i> or <i>M</i> or <i>G</i>?<p>- <i>N</i> = # of registers<p>So the simplest example would be <i>D</i>/<i>D</i>/1, where - for example - every 3 seconds a customer enters the line and every 1.5 seconds a customer is checked out by a single register. Not very exciting. At a higher level of complexity, <i>M</i>/<i>M</i>/1, we have a single register where customers arrive at rate <i>_L</i> and are checked out at rate <i>_U</i> (in units of # per time interval), where both <i>_L</i> and <i>_U</i> obey Poisson distributions. (You can also model this as an infinite Markov chain where your current node is the # of people in the queue, you transition to a higher node with rate <i>_L</i> and to a lower node with rate <i>_U</i>.) For this system, a customer's average total time spent in the queue is 1/(<i>_U</i> - <i>_L</i>) - 1/<i>_U</i>.<p>The intelligent routing system routes each customer to the next available checkout counter; equivalently, each checkout counter grabs the first person in line as soon as it frees up. So we have a system of type <i>M</i>/<i>G</i>/<i>R</i>, where our checkout time is <i>G</i>enerally distributed and we have <i>R</i>>1 servers. Unfortunately, this type of problem is analytically intractable, as of now. There are approximations for waiting times, but they depend on all sorts of thorny higher moments of the general distribution of checkout times. But if instead we assume the checkout times are randomly distributed, we have a <i>M</i>/<i>M</i>/<i>R</i> system. In this system, the total time spent in queue per customer is C(<i>R</i>, <i>_L</i>/<i>_U</i>)/(<i>R</i> <i>_U</i> - <i>_L</i>), where C(a,b) is an involved function called the Erlang C formula [2].<p>How can we use our framework to analyze the naive routing system? I think the naive system is equivalent to an <i>M</i>/<i>M</i>/1 case with arrival rate <i>_L_dumb</i> = <i>_L</i>/<i>R</i>. The insight here is that in a system where customers are instantaneously and randomly assigned to one of <i>R</i> registers, each register should have the same queue characteristics and wait times as the system as a whole. And each register has an arrival rate of 1/<i>R</i> times the global arrival rate. So our average queue time per customer in the dumb routing system is 1/(<i>_U</i> - <i>_L</i>/<i>R</i>) - 1/<i>_U</i>.<p>In OP's example, we have on average 9000 customers arriving per minute, or <i>_L</i> = 150 customers/second. Our mean checkout time is 306ms, or <i>_U</i> ~= 3. Evaluating for different <i>R</i> values gives the following queue times (in ms):<p># Registers 51 60 75 100 150 200 500 1000 2000 4000<p>dumb routing 16,667 1,667 667 333 167 111 37 18 9 4<p>smart routing 333 33 13 7 3 2 1 0 0 0<p>which are reasonably close to the simulated values. In fact, we would expect the dumb router to be comparatively even worse for the longer-tailed Weibull distribution they use to model request times, because you make bad outcomes (e.g. where two consecutive requests at 99% request times are routed to the same register) even more costly. This observation seems to agree with some of the comments as well [3].<p>[1] <a href="http://en.wikipedia.org/wiki/Queueing_theory" rel="nofollow">http://en.wikipedia.org/wiki/Queueing_theory</a><p>[2] <a href="http://en.wikipedia.org/wiki/Erlang%27s_C_formula#Erlang_C_formula" rel="nofollow">http://en.wikipedia.org/wiki/Erlang%27s_C_formula#Erlang_C_f...</a><p>[3] <a href="http://news.ycombinator.com/item?id=5216385" rel="nofollow">http://news.ycombinator.com/item?id=5216385</a>