贝克勒尔作为请求速率的国际单位
The becquerel as an SI unit for request rate

原始链接: https://entropicthoughts.com/si-units-for-request-rate

讨论请求速率——一段时期内的请求数量——至关重要的是**明确该时期**,理想情况下定义为**每秒请求数**。含糊不清的仪表盘可能会根据缩放级别显示不同的速率,导致数据不一致。 虽然**赫兹 (Hz)** 和 **贝克勒尔 (Bq)** 都表示每秒发生的事件,但**贝克勒尔更适合请求速率**,尽管它最初与放射性有关。赫兹暗示可预测的、周期性的事件,而贝克勒尔更好地反映了通常不规则请求的平均频率(例如网站流量)。 对于高容量速率,贝克勒尔提供更简洁的表示法(例如,90 kBq 与 90,000 请求/秒)。虽然有人建议使用一个新单位(“rips”),但利用现有的贝克勒尔,并将其接受的含义扩展到放射性之外,为一致地测量和沟通请求速率提供了一个实用的解决方案。作者希望贝克勒尔未来能成为一般事件频率的标准。

Hacker News新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交登录 贝克勒尔作为请求速率的 SI 单位 (entropicthoughts.com) 14 分,作者 fanf2 3 小时前 | 隐藏 | 过去 | 收藏 | 2 条评论 帮助 avmich 1 分钟前 | 下一个 [–] 我们能讨论 - 或假设,或理解 - “平均请求频率”并仍然使用赫兹作为单位吗?回复 hirsin 12 分钟前 | 上一个 [–] 用每分钟请求数而不是每秒请求数来衡量有什么明显的理由吗?还是一个随意的玩笑?我参与过的一些系统 API 平均每秒少于一个请求,但我不认为我们想用毫贝克勒尔来衡量。有些系统测量的是每小时数百万个请求,因为每小时的使用量是一个关键指标,因为速率限制也是按小时计算的。回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Request rate is the number of requests that arrive, or are serviced, or leave, during some period.

It’s surprisingly common for people to speak of a request rate without specifying what the length of the period is. I have even seen dashboards that don’t have a fixed period for the metrics query – the request rate becomes measured per whatever aggregation interval the dashboard deems appropriate for the window size at the time. If you zoom out, you get a higher request rate. If you move the window to a high-resolution screen, you get a lower request rate.

We should specify the period length in the query to the metrics database, so everyone sees the same request rate regardless of how many pixels their dashboard occupies at the time.

The good period length to use is the second. Request rates should be measured as the number of requests per second.1 I have met some people who measure requests per minute. Don’t be those people. This sounds like it would have an si unit, i.e. we should be able to say something like “our request rate is 57 watts.” Except obviously not watts.


Turns out there are two si units that both could fit:

  • The hertz, or Hz, is the si unit of frequency. It is defined as one event per second.
  • The becquerel, or Bq, is the si unit of (radio)activity. It is also defined as one event per second.

Why are there two units for the same thing? A physicist that hears that an event occurs at 4 Hz will assume that there is one event exactly every 250 milliseconds. The hertz unit is strongly associated with periodic behaviour. Radioactive decay is not that well behaved, and will happen only on average with the given frequency. A sample that decays at 4 Bq may decay zero times one second, and then 9 times the next.2 Assuming a Poisson distribution, these will be rare events, but if you look at the sample for an hour, you have a better than 50 % chance of observing that exact sequence of decays.

It makes sense then that we would say the request rate is 500 Hz when we talk about highly regular load testing, where one request is issued consistently every 2 ms. But if it’s about organic traffic that happens to arrive at an average of 500 times per second, then maybe saying 500 Bq is more appropriate.

This is also convenient when we are nearing request rates static web servers or caches handle. Saying “ninety kilobecquerel” and writing “90 kBq” is a lot more convenient than “ninety thousand requests per second” and “90,000 requests/s”.3 A reader suggested inventing the unit “rips” instead, which I like both the idea and sound of, but I’m a sucker for bending standards to my will.


Except! It seems that – in contrast to the hertz which is a general unit – the becquerel is meant to be specifically about radioactive decay. There’s no si unit for arbitrary events that happen on average with a certain frequency. I will keep using the becquerel for request rates, and I hope that 50 years from now, we will have forgotten the silly mistake of thinking it was only about nuclear decay.

联系我们 contact @ memedata.com