8 comments

  • trb6 hours ago
    Considering other metrics then p99 for user impact is unwise. All users will at some point experience a &lt;1% request, it&#x27;s not like half of all users will only send requests what will be under your median latency, some of their requests will hit your worst-case.<p>By focusing on the tail and optimizing worst cases you help users more than by improving your median latency.
  • uberex2 hours ago
    &gt; More technically, what’s going on here is the inspection paradox. Alex and Alice don’t experience your latency distribution , they experience a t-weighted version of it<p>Ooh I got pushed in the 2m end of the pool there. What is the intuition? The ten hundred most popular words sort of thing.<p>I am very interested in this article though. At first I assumed it would be about TTFB vs. time to render the page after all those async useEffects have run, but it isn&#x27;t that this is something else and I am very interested.
    • CrazyStat1 hour ago
      Perhaps an easier to intuit version of it is how full airliners are.<p>An airline might report that their flights are on average 60% full, and that might be completely absolutely 100% true. But that&#x27;s not what passengers experience. If we assume (for convenience) that a plane holds 100 people, when the plane is 20% full then 20 passengers experience that, but when the plane is 100% full then 100 passengers experience that. On average, from a passenger&#x27;s point of view, the flights are much more than 60% full--it might be 70 or 80%--because a full flight is experienced by more passengers than an empty flight.<p>For a concrete example imagine two flights, one 20% full and one 100% full: the average is 60% from the airline&#x27;s point of view, but 100 passengers experienced a full flight and only 20 experienced the 20% full flight, so from the passenger&#x27;s point of view the average is 86.7% full.<p>The same logic applies to outages. If you have an outage that lasts one minute then only a few users will encounter it. If you have an outage that lasts one hour then many more users will encounter that. The longer the outage is, the more likely any given user is to encounter it, so from the user&#x27;s point of view the &quot;average&quot; outage is much longer than the &quot;true&quot; average where you weight every outage equally.<p>Again we can consider a concrete example: imagine you run a website that gets 100 visitors per minute. You have one outage that lasts 1 minute, then later a second outage that lasts 9 minutes. Your average outage time is 5 minutes. But 100 visitors experienced the 1 minute outage, while 900 visitors experienced the 9 minute outage, so from the point of view of a visitor the average outage is (900*9 + 100*1)&#x2F;1000 = 8.2 minutes.
    • mungoman22 hours ago
      Similarly curious about this. The intuition I extracted:<p>Let’s say we have 10 requests, where 9 of them take 1 second to complete but one that takes 100 seconds. The average time to complete a request is about 10 seconds, but if you experience the requests in series, at any given time you’re much more likely to sit and wait in one of those 100 second requests.<p>So if you imagine a long series of requests from this distribution and place yourself randomly in the series, the average time to completion is just a bit less than 50 seconds.<p>This is what is meant by t-weighted, that events with a large t take a larger place.
      • uberex43 minutes ago
        I see it is about a long series of requests. Makes sense. Ill start looking at latency at p99.9 and p99.99 more often now!
    • diatone2 hours ago
      AIUI: my intuition is Alex and Alice are points in the distribution. They don’t think about their experience in terms of population statistics. They see their individual latency times, and use that as their sample. If t is low in their experience, great the distribution is low.<p>But for any t that goes high that they observe (which tends to be the case in a skewed distribution such as service latencies), it drags their impression of the distribution up, dominating the shape of that impression.
    • reinitctxoffset34 minutes ago
      Arithmetic mean is just really bad for latency conversations (ditto MTTR). Other averages have their place but for a legible, accessible chart that&#x27;s 4 lines in anything: p50, p75, p95, p99.9 with the last having the SLA is IMHO the right thing to goal and alert on in a cross-functional setting that&#x27;s attaching engineering outcomes to business outcomes.<p>There&#x27;s better math for advanced introspection, but for stuff everyone in the room can intuit no matter their discipline, that&#x27;s a really sweet spot.<p>And it&#x27;s motivating: the p99.9 latency is a bunch of quick, high-impact wins if you haven&#x27;t profiles it yet. A good time is had by all.
  • rustybolt6 hours ago
    This article contains very little substance. Show me the math!
    • AgentOrange12346 hours ago
      Yes I found this very hard to follow. I appreciate expressing ideas in math like E_a[X] as much as the next guy, but there is no definition or even description of what the heck E or E_a or Var(x) even mean, so how is anyone supposed to understand the reasoning here? All I get from this is a claim that experienced latency is different than the mean, which sounds important, but I still have no intuition as to why this is. Which is sad, because Booker&#x27;s blog is often deeply amazing.
      • NightMKoder5 hours ago
        This is standard statistics terminology - E(X) is <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Expected_value" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Expected_value</a> . E_a is presumably Alice&#x27;s perceived expected value. Var(X) is <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Variance" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Variance</a> . The law of large numbers says the arithmetic average of observations becomes E(X) with enough samples.<p>I&#x27;m pretty sure what the author is saying is:<p>E(X) =:= \sum_t(t * P(X = t)) is the definition<p>another important note is P(X^2 = t^2) = P(X = t) - because it&#x27;s the same distribution.<p>E_a(X) is a bit sloppy, but consider X_a aka Alice&#x27;s latency &quot;experience&quot; distribution. The argument is:<p>P(X_a = t) = t * P(X = t) &#x2F; \sum_u(u * P(X = u)) - i.e. scale the probability up by t but make it sum to 1.<p>Then<p>E(X_a) = \sum_t(t * P(X_a = t)) = \sum_t(t * t * P(X = t) &#x2F; \sum_u(u * P(X = u))<p>aka<p>E(X^2) &#x2F; E(X)<p>Then (from wikipedia)<p>Var(X) = E(X^2) - (E(X))^2<p>And we get<p>E(X_a) = (Var(X) + (E(X))^2) &#x2F; E(X) = E(X) + Var(X) &#x2F; E(X)
      • canjobear3 hours ago
        I was clicking around in response to this article and found this video that explains the inspection paradox nicely. <a href="https:&#x2F;&#x2F;youtu.be&#x2F;Jd1wNizPjoE" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;Jd1wNizPjoE</a>
  • ggm4 hours ago
    Interesting you work at Amazon and show how end user experience weights to their pessimal experience.<p>So.. apply that to Amazon design heuristics like author name search on books, and how Amazon return &quot;in the style of&quot; and &quot;not a book but this guy called Charles Dickens makes jigsaws&quot; as high order matches and consider how the end user experience weights to the pessimal yet Amazon can show on average they make more money doing this..<p>(Understood that engineers and AWS don&#x27;t influence UX in the storefront or search)
    • cowthulhu3 hours ago
      Comments like these seem likely to discourage authors from making more interesting posts about niche topics they specialize in, without actually moving the needle on stuff the commenter is pestering about.
      • ggm3 hours ago
        Yes, has that risk. If I were to neutralise it I&#x27;d observe any system which assesses UX will trip over this, the majors are no exception. It serves as a useful reminder tuning isn&#x27;t optimised solely for your(as a user) benefit.
  • perching_aix6 hours ago
    I&#x27;ve grown to dislike the typical tail measurements completely. What I usually look at these days is what share of unique users experience an &quot;unacceptable experience&quot; over a measurement period instead.<p>I find it much more inquisitive and visceral, to the extent that p99 now boggles my mind. 2N would be dreadful as an availability figure, yet for UX it&#x27;s treated very different. So much so that my measurements corroborate exactly that; good UX requires the same many-nines reliability as e.g. DCs, not one or two.<p>I wonder if it&#x27;s p90 and p99 to blame for the shoddy services we have, in a way. It&#x27;s pretty hard to argue for fixing something when it&#x27;s presented as only going wrong 0.5% or less of the time after all. Even if at scale that means most of your users are experiencing it weekly.
    • AkshatM3 hours ago
      How does one measure unique users here in a way different from classic p99? I usually associate p99 with an SLO of some kind, and each request as a &quot;unique user&quot; for the service, so at first it seems like the same thing - measuring p99 with a SLO would say 1% of users are allowed to experience a time longer than our acceptable minimum T, and you&#x27;re measuring the percentage of requests (&quot;users&quot;) experiencing T and trying to keep it below 1% (e.g.).<p>Is the difference more about measuring a request &quot;across services&quot;? That is, the total cumulative p99 across services must be small i.e. linking all requests to a user and then measuring that? Or is the difference elsewhere?<p>If the former: are you taking traces and graphing that? What&#x27;s your methodology?
      • pramodbiligiri1 hour ago
        I believe “sessionization” is a common term used for this: <a href="https:&#x2F;&#x2F;dev3lop.com&#x2F;blog&#x2F;sessionization-in-clickstream-event-processing&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dev3lop.com&#x2F;blog&#x2F;sessionization-in-clickstream-event...</a>
      • perching_aix3 hours ago
        I think you got it, but let me maybe lay it out more explicitly with a specific example.<p>I visit HN, that&#x27;s one request. But I visit HN multiple times a day. So for the operation that serves the homepage, if you took e.g. a past 24hr latency p99 chart, the number of requests analyzed would not be the same as the number of unique users involved in making those requests, potentially drastically so.<p>So you might see a p99 you&#x27;re comfortable with, and conclude that since only 1% of requests were worse than that, it&#x27;s fine. In practice though, depending on how &quot;well-trodden&quot; that operation is, you might very well be in a situation where <i>all</i> users experienced <i>at least one</i> such beyond-SLO event that day, since the mapping is many to one.<p>The cross operation version of this is important as well, yes. You can have users experience snags across common flows too for example, same idea.<p>Regarding methodology, it&#x27;s nothing special, I just rely on user IDs and correlation IDs. It really is just a perspective shift, the underlying data is the same. You can even calculate back the &quot;number of nines needed to get an acceptable UX&quot; using this, as long as the general usage habits are stable. It&#x27;s just gonna be a lot more nines than two in my experience.
  • zaik6 hours ago
    Is the formula for E_a[X] trivial? I don&#x27;t see it immediately...
    • kgwgk4 hours ago
      E[X^2] weights each time with the time, giving the square, and the E[X] in the denominator is the normalisation factor (also required to fix the dimensions).<p>Say that there are to different waiting times 1s and 3s, and they happen with probability 50% each. The average waiting time (1&#x2F;2 1+1&#x2F;2 3) is 2s. However, 75% of the time we are waiting on a 3s event and only 25% on a 1s event. The weighted average is 2.5s. E[X^2]=1&#x2F;2 1+1&#x2F;2 9=5(s^2) is not the right answer, it still has to be divided by E[X]=2(s) to get the correct answer.