14 comments

  • bijowo167613 hours ago
    the article offers a simplified world model: Poisson arrivals and infinite queue, which is fine as a math model.<p>In the real world however, the bursts can be correlated, due to factors like timeouts&#x2F;retries, thundering herd, correlated bursts.<p>so the real economics of load-balanced system is a simple reliability story: being able to reasonably serve the peak traffic, which leads to over-provisioning of those systems.<p>using cloud allows some form of scale up&#x2F;down of resources, but doesn&#x27;t completely solve the problem. I think the migration away from synchronyous systems towards async systems and letting clients gradually absorb the delays is a better approach (rather than forcing infrastructure to be dynamically scaled up&#x2F;down and be billed per request-second by your cloud provider)
    • PaulHoule38 minutes ago
      I&#x27;ll argue though there is a political and ideological dimension to queuing theory, especially when it comes to systems where humans are handling the work.<p>In the idealized case the comfortable place to operate a system is with around 2&#x2F;3 utilization, like around there latency (customer experience, employee experience) is reasonable, slack is reasonable, etc.<p>A manager who is being managed by a manager who is being managed by a manager who is being managed (...) is going to see 0.99 utilization and want that last 0.01 and be oblivious to the fact that the math says the system is already past the breaking point, customers are furious, employees are worn out. Any slack at at all seems like an affront.
    • fmajid3 hours ago
      As in the classic paper &quot;Wide-area traffic: The failure of Poisson modeling&quot; by Vern Paxson (author of GNU flex) and Sally Floyd (legend in the world of TCP&#x2F;IP congestion control):<p><a href="https:&#x2F;&#x2F;www.osti.gov&#x2F;servlets&#x2F;purl&#x2F;10107457" rel="nofollow">https:&#x2F;&#x2F;www.osti.gov&#x2F;servlets&#x2F;purl&#x2F;10107457</a>
    • genxy9 hours ago
      Another technique to add to the mix if you can handle the additional complexity is to load or feature shed. If you can delay or just drop additional expensive application features during the exact time you need to scale or handle a burst, then your system has additional core app logic to handle requests. This can prevent the system getting wedged in a positive feedback loop.<p>See also the gamedev technique of having sacrificial assets or code, so when you need to free up space late in the schedule to ship, you have something you can actually shed.
      • Ylano4 hours ago
        Having something intentionally non-essential to cut is much better than discovering under pressure that everything is load-bearing
    • cherryteastain4 hours ago
      &gt; the bursts can be correlated<p>Hawkes processes are what other fields use to model this
    • Joel_Mckay12 hours ago
      &gt;In the real world however, the bursts can be correlated<p>Very true, as application-layer load-balancing often explicitly pre-bakes the traffic schedule to several hundred distributed IPs for data locality. Essentially bypassing the functional need for DNS and local round-robin traffic balancers.<p>One trades concurrent bandwidth for slightly higher latency, and dynamically adapted capacity as traffic load changes. =3
      • laz9 hours ago
        If your clients are all this well behaved, then you’re definitely not exposed to the public internet.<p>The global edge networks that I’m aware of all use L4 LBs and L7 LBs. Cloudflare picks anycast over DNS LB, but DNS LB is still widely used.<p>I don’t see these things changing.
        • Joel_Mckay8 hours ago
          &gt; I don’t see these things changing.<p>Time Division Multiplexing is usually already used on cellular and Wifi wireless protocols. It only requires slight modification to turn it into an effective network traffic balancer to avoid the naive &quot;everyone update on Tuesday 6am UTC&quot;, or &quot;It is Christmas morning and game registration is open&quot;.<p>Notably, it also allows tracking specific accounts by encoding disjoint ingress host lists (siloed concurrent user groups with client certs and firewall whitelist rules.) And users do not have global network knowledge as hosts are cycled into temporary stewardship under load. Thus, only the coordinators for one-time new-user registration operates on classical DNS&#x2F;round-robin host services.<p>With DNS, by expected function everyone knows the global published ingress points within minutes. Under a DoS the traffic just hammers down, and small firms usually just pay for the Cloudflare like services.<p>For systems I&#x27;ve known, TDM reduced peak resource capacity costs down by around 37x. Generally speaking, a 100 user group having fun will not share their server details&#x2F;invites with folks that exhibit lag-switching or other network shenanigans.<p>But you are correct, in that it doesn&#x27;t help if PIBKAC. =3
          • laz7 hours ago
            We&#x27;re definitely talking about different things. The open internet is hostile and you&#x27;ll always need load shedding when the clients misbehave.<p>If you control all clients and servers and are on a closed network, you can do all sorts of fun things... though load shedding is helpful for when your good clients turn bad due to a code bug. A self DoS is the worst kind of outage.
    • Ylano4 hours ago
      [dead]
  • mjb13 hours ago
    A dead comment says:<p>&gt; Of course, this assumes independent events. World Cup, super bowls, etc break these assumptions.<p>Yes, this is very true. The model here works for Poisson arrivals and exponential service time (the M&#x2F;M), which are poor approximations of real-world traffic patterns (which tend to be non-stationary and non-ergodic, and include substantial seasonality). However, the frequency of that seasonality is typically rather low (e.g. daily cycles), and so these stronger assumptions are quite defensible for short time periods.<p>A better approach is to do simulation with real traffic patterns, or even with more sophisticated parametric models, and get better answers (e.g. <a href="https:&#x2F;&#x2F;stability-sim.systems&#x2F;" rel="nofollow">https:&#x2F;&#x2F;stability-sim.systems&#x2F;</a>). The good news is that kind of simulation is cheaper to do than ever before.
  • juergn3 hours ago
    M&#x2F;M&#x2F;c is not the right model for a typical loadbalancer, since a loadbalancer typically does not manage a shared queue but simply passes the jobs to one of the servers. The models are:<p>- M&#x2F;M&#x2F;1 (vertical scaling, one queue and one fast server): fastest response time<p>- M&#x2F;M&#x2F;c (thread-pool, one shared queue, c slow servers): c-times slower for low loads, asymptotically similar to M&#x2F;M&#x2F;1 for high loads<p>- c-times M&#x2F;M&#x2F;1 (loadbalancer, c slow servers each which its own queue): always c-times slower than M&#x2F;M&#x2F;1.<p>Only the response times are different. Throughtput is the same in the ideal case.
  • megamalloc14 hours ago
    What&#x27;s conspicuously missing is the plot of performance when you do have a well tuned queue in front of the service. Yes, having a queue becomes less important the more backend servers you have, but here even with 10 servers the plot shows your latency remains &gt;25% worse than it would be with a queue. Also missing is discussion of how the variance in processing times affects you when you rely on load balancing alone.
    • mjb13 hours ago
      &gt; What&#x27;s conspicuously missing is the plot of performance when you do have a well tuned queue in front of the service.<p>As in between the service and the load balancer? There&#x27;s already an infinite queue in the load balancer. You can try that out on <a href="https:&#x2F;&#x2F;stability-sim.systems&#x2F;" rel="nofollow">https:&#x2F;&#x2F;stability-sim.systems&#x2F;</a> to see the effect, but the short version is that (in this model) it makes things worse.<p>If you&#x27;re saying that the queue in the load balancer should be limited in size to reduce tail latency, then I agree.
      • megamalloc13 hours ago
        No, I mean when you have a queue broker that the backends can pull work from when they become idle, rather than relying on load balancing which will send work to backends while they&#x27;re still busy.
        • wmf11 hours ago
          This scenario already works that way. The very first sentence says &quot;servers, each of which can only handle a single concurrent request, and has no internal queuing&quot;. This implies that the load balancer waits for a server to finish a request then immediately sends the next one.
          • megamalloc10 hours ago
            I don&#x27;t believe it does. As I understand it, the load balancer has a queue in which it can buffer infinite requests, but it drains that queue by pushing work to the backend servers in what&#x27;s probably a round-robin fashion. So there is secondary queueing at each server. Even the &quot;least connections&quot; strategies available through some load balancers do not usually behave as you might expect (by always sending the next request to a server that&#x27;s idle). Pull-based load balancing via a queue has its own downsides but the big upside is to make latency essentially a constant low overhead regardless of the number of servers in the typical case.
  • crypttales15 hours ago
    Of course, this assumes independent events. World Cup, super bowls, etc break these assumptions.<p>Still, queuing theory is so cool.
  • resters9 hours ago
    It&#x27;s not surprising if one has the mental model of the probability that the request gets enqueued. Then when you add variable time to process requests it becomes more clear why some requests can take unexpectedly long (there is a &gt;0 probability that a request gets queued behind several of the slowest endpoints, for example). So even if 90% of the endpoints are fast and most of the requests aren&#x27;t even queued, there will still be some that end up being quite slow.
  • nilsherzig14 hours ago
    Why would anyone think that it would get linearly worse? What&#x27;s the (wrong) assumption there?
    • jldugger5 hours ago
      I&#x27;m mostly just surprised the graph starts at 5 seconds for a mean value for all datapoints. I would have assumed it starts much closer to 1s. Which just makes the poll responses even crazier. Who is picking B when you have 25% more capacity than you need?<p>But I suppose the question is underspecified. How does the load balancer know which systems are busy? What happens to a request if the load balancer routes a request to a busy server?
    • physix13 hours ago
      I thought the same thing. But, should we be surprised about what people believe in these days?<p>I think that the issue is in part due to the variables. Plotting the mean request time is less intuitive than plotting throughput.<p>If you plot throughput vs number of servers, it&#x27;ll be a straight line. And asking people that, I think most would agree on a straight line. But who knows!
    • mjb13 hours ago
      One explanation would be that more load could mean higher (absolute) variance in queue length, and therefore higher latency especially at higher percentiles. It doesn&#x27;t work out that way (for reasons that Erlang actually writes about in one of his original works), but it&#x27;s not an entirely unreasonable intuition.
    • PunchyHamster14 hours ago
      I think author made it up just to have something more to show up on graph.
      • antonvs14 hours ago
        It was a poll on Twitter, do you really expect good responses?
  • fabijanbajo5 hours ago
    The footnote on exponential vs. log-normal service times is the part I&#x27;d push on.. in production I almost never see exponential, and heavy tails change the picture. Curious if you&#x27;ve looked at how robust this is under realistic distributions
  • Ylano4 hours ago
    80% utilization is not a universal statement
  • jiggawatts7 hours ago
    The problem with this kind of theoretical analysis is that most load balancers <i>don&#x27;t work this way</i>, especially the typical &quot;cloud&quot; HTTP or TCP load balancers, which are stateless and avoid this kind of central queuing logic like the plague because <i>it doesn&#x27;t scale</i> to their levels.<p>For example, most cloud load balancers I&#x27;ve worked with are stateless, non-queuing, and allocate work to back-ends strictly randomly.<p>Traditional non-cloud load balancers <i>can</i> implement this kind of perfect queuing, but these settings are generally off by default even when available.<p>- NetScaler: surgeProtection + maxClient=1<p>- F5 BIG-IP LTM: request queuing + pool&#x2F;member connectionLimit=1<p>- HAProxy: server maxconn 1 + timeout queue<p>- NGINX Plus: server max_conns=1 + queue<p>Envoy, Apache, and Traefik have partial or limited support.<p>Conversely, most multi-threaded web server frameworks already do this by default! For example, ASP.NET has essentially an internal &quot;load balancer&quot; with a perfect queue if you pretend each core is a &quot;node&quot; and the whole server is the &quot;scale out system&quot;.
  • anchorapi4 hours ago
    [flagged]
  • ukanwat7 hours ago
    this whole result leans on one assumption he mentions and then sets aside: independent, stateless requests. that&#x27;s really the load-bearing part. as soon as the c units share mutable state or have to coordinate, the M&#x2F;M&#x2F;c model stops applying and the pooling benefit goes with it. you trade it for coordination cost that grows with the number of pairs, not the number of workers. I hit this constantly with multi-agent LLM systems. people add agents expecting load-balancer style scaling and land in the opposite regime, because the work isn&#x27;t independent, the agents are writing to shared state. so &quot;pooling is cheap&quot; is really &quot;pooling independent work is cheap,&quot; and the independent part is where all the benefit actually comes from.
  • bigcat1234567814 hours ago
    Seemingly inconsequential article on hacker news and assume it probably is the kind of article that describes a profound idea with a naive title. And turns out it&#x27;s actually very confusing as it puts overweight dramaticity over mundane intuition. Those type of writing belongs to literature sphere, not technology writing.