Most performance figures report. These two argue. One puts a unit on the horizontal axis so a box stops being a name and starts being a share of the cost. The other puts the wait against utilisation, which is the one relationship people reliably get wrong, because the axis is linear and the experience is not.大多数性能图是在汇报。这两张在讲道理。一张给横轴加上单位,于是一个方块不再只是个名字,而是一份开销占比。另一张把等待画在利用率上——这是人们最容易搞错的一条关系,因为轴是线性的,体验不是。
Nothing on this page is a measurement. The profile percentages were chosen so the arithmetic adds up, and the queue curve is the textbook shape for one server with random arrivals. Both figures say so on their own faces, because a figure that looks like data and is not is worse than one that never pretended. What is real is the shape of both relationships, and the shape is what these two figures exist to argue about.这一页上没有一个数字是实测的。采样占比是挑出来让算术对得上的,队列曲线是单服务台、随机到达那个教科书形状。两张图自己都写明了这一点——因为一张长得像数据、其实不是的图,比一张从不假装的图更糟。真实的是两条关系的形状,而这两张图存在的理由就是为那个形状讲道理。
In an ordinary call graph, a box is as wide as its name happens to be. That is a whole dimension carrying nothing, and filling it costs nothing: let width be share of samples and the same six functions stop being a structure and become a budget. The figure shows both drawings side by side because the difference is easier to accept than to describe — the left one is not wrong, it simply answers “who calls whom” and was never going to answer “where did the time go”.在普通的调用关系图里,一个方块的宽度由它名字的长度决定。那是一整个维度什么都没承载,而把它填上不花任何代价:让宽度等于采样占比,同样这六个函数就从一个结构变成了一本账。这张图把两种画法并排放,是因为这个差别更容易被接受而不是被描述——左边那张并没有错,它答的是「谁调用谁」,本来就不打算答「时间去哪儿了」。
Show somebody three queues at three loads and they will read a proportion: busier means proportionally slower. The real relationship bends. Going from half busy to eighty per cent busy costs four times the wait; going from eighty to ninety-five costs another five times on top of that. This is the single most reliable gap between what a utilisation number feels like and what it does, and a picture of queues cannot close it on its own — only the curve underneath can.给人看三个负载下的三条队列,他读到的是一个比例:忙一点就按比例慢一点。真实的关系是弯的。从半忙到八成忙,等待变四倍;从八成到九成五,在此之上再乘五倍。这是「一个利用率数字给人的感觉」和「它实际造成的后果」之间最稳定的一道落差,而光画队列关不上这道落差——只有底下那条曲线能。
One server, random arrivals — so treat it as the floor单服务台、随机到达 —— 所以把它当下限
A real system has bursts, and bursts bend the curve earlier and harder. So the honest way to use this figure is as the best case: whatever it says the wait will be at a given load, the machine in front of you will be worse. That is also why a target of eighty per cent utilisation is a decision about how much bad news you are willing to buy, not a safety margin.真实系统有突发,而突发让这条曲线弯得更早、更狠。所以老实的用法是把它当最好情况:它说某个负载下等待是多少,你面前那台机器只会更差。这也是为什么「利用率目标 80%」是一个「你愿意买多少坏消息」的决定,而不是一条安全余量。