[HN Gopher] SI Units for Request Rate
___________________________________________________________________
SI Units for Request Rate
Author : DaveFlater
Score : 65 points
Date : 2024-02-01 18:45 UTC (2 days ago)
(HTM) web link (two-wrongs.com)
(TXT) w3m dump (two-wrongs.com)
| DaveFlater wrote:
| The "two wrongs" hostname is apt. Hertz is for periodic
| phenomena; becquerel is for radioactive decay. The SI brochure
| discourages the use of counting units such as 'request'. The
| number of requests is regarded as just a number, or at best a
| quantity that is referred to the unit one. The applicable SI unit
| therefore is just the reciprocal second, s^(-1).
|
| In practice, counting units are used everywhere (e.g., in MB/s,
| the byte is a counting unit), but I am relaying what the SI
| brochure actually says on this question.
|
| Ref: https://www.bipm.org/en/publications/si-brochure/
| basil-rash wrote:
| No way the same org that named the mole a unit discourages the
| use of counting units.
|
| I think what we are really after is yoctomole Becquerels.
| krastanov wrote:
| Interestingly, a "conservation of matter" law can exist
| independently of atoms. I.e. it is mathematically consistent
| to create a universe in which a "mole" is necessary, but
| matter is not discrete. Therefore "mole" can be considered a
| bit more fundamental (in any universe). I find it reasonable
| to stick to using a "mole" unit on that basis, although I
| would not be dying on this hill.
| jameshart wrote:
| It can, in my experience, be very useful to introduce a unit
| for 'requests', as well as one for 'CPUs'.
|
| It lets us produce dimensionally valid formulae for relating
| request rates (in requests per second) to compute requirements
| (in CPU seconds per request), data transfer (in bytes per
| request), and bandwidth (in bytes per second).
|
| I kind of wish software engineering's computer science
| underpinnings offered a few more of the kind of notational
| underpinnings that physics offers mechanical or electronic
| engineers.
|
| Why don't we have a standard set of letters for representing
| data sizes, requests, compute units, etc; and a set of widely
| known formulae as familiar to every programmer as V=IR is to an
| electrical engineer?
|
| The only standard symbol computer science has given us (or
| maybe more accurately that we have taken up) is _n_ , as in O(
| _n_ ), for collection sizes.
|
| I wonder if we can do better?
| DaveFlater wrote:
| ISO 80000 Part 13 gives some symbols within the scope of
| communication technology (its scope is more narrow than its
| title would suggest). The standard itself is copyrighted but
| the quantity symbols are listed on Wikipedia, https://en.wiki
| pedia.org/wiki/ISO/IEC_80000#Part_13:_Informa...
|
| See also https://www.nist.gov/publications/quantities-and-
| units-softw...
| jameshart wrote:
| That is fascinating. Are there any examples of 'fundamental
| laws' expressed in these terms?
| DaveFlater wrote:
| Being careful to distinguish 'fundamental laws' from just
| 'quantities that we defined', information theory and
| queueing theory have some good examples of proven laws.
| boolemancer wrote:
| Personally I like variable names better than symbols anyway.
| asveikau wrote:
| A cpu second means very little without more context. CPU
| performance depends a lot on things like cache, branch
| prediction, out of order execution. Each second represents
| something fairly distinct from the others.
| jameshart wrote:
| It's not ambiguous when the Amazon bill arrives.
| nyrikki wrote:
| In reference to (per duration) values "requests per second"
| is ambiguous, what is a request?
|
| Instructions per seconds exists but is only useful for
| comparing tasks on the same hardware and architecture. We saw
| the abuse of MIPS for comparing machines in the past just as
| we see it with FLOPS in GPUs today.
|
| MIPS benchmarks like whetstone differ even on the same CPU
| depend on the language used, compiler used, and the options
| at compile time. TPC, SPEC and other synthetic benchmarks
| just succumbed to game theory and usually don't apply to real
| world loads.
|
| The field you want to look into is "Queuing Theory"
|
| If you are lucky enough that you can assume your system is
| Markovian you get simple formula like:
|
| mean service time == 1/(mean service rate)
|
| To show just how old it is here is a good paper about M/M/1
| queues from 1958 that is still useful today.
|
| https://msp.org/pjm/1958/8-1/pjm-v8-n1-p08-s.pdf
| jameshart wrote:
| In reference to V=IR, 'current' is ambiguous. Current over
| what?
|
| Depends what system you're analysing. But the dimensional
| validity of that statement is applicable in numerous
| circumstances.
| nyrikki wrote:
| 1 Amp == the flow of 1/(1.602176634 x 10^-19) elementary
| charges per second.
|
| The medium used for flow isn't important for that
| calculation at all. Just as it would be for liters per
| second.
| thaumasiotes wrote:
| > Hertz is for periodic phenomena
|
| > The applicable SI unit therefore is just the reciprocal
| second, s^(-1).
|
| That's the hertz.
| petschge wrote:
| While Hertz are 1/s, there is implications between using
| frequencies in Hertz and rates in 1/s. Units are not just
| something to mechanically check, but _also_ for communication
| with other humans. So connotations matter in addition to
| denotation.
| DaveFlater wrote:
| Hertz, becquerel, et al. are algebraically defined as s^(-1)
| yet intended to be used for different kinds of quantities.
| The SI brochure also allows replacing radian by 1, which
| brings angular velocity into the fight. Further reading:
| https://doi.org/10.1088/0026-1394/52/1/40
| jameshart wrote:
| And that brings up the difference between frequency and
| angular frequency.
|
| When you use hertz meaning 'cycles per second' it's far
| more natural to associate it with an angular velocity of
| 2pi radians per second - which throws a bit of a spanner in
| the dimensionless works, and makes it feel like using 1/2pi
| as a radian makes more sense.
|
| Score another point for tau I guess.
| OskarS wrote:
| Would you say that one watt is equal to one joule-hertz?
| paulsutter wrote:
| If becquerel why not microfortnight? (about a second)
| amluto wrote:
| That's not the same thing at all. You obviously mean the
| inverse microfortnight.
| basil-rash wrote:
| And the problem with that of course is whether the ufn is
| 1,000/(2 weeks) or 1/(2,000 weeks).
|
| All in all the Bq is a cool unit! I learned something today.
| afc wrote:
| Because the point is to have a Si unit of event rate
| (becquerel), not of time. Otherwise, if micro-fortnight (about
| a second), why not ... second?
| diarrhea wrote:
| I don't understand what's wrong with Hz. Bq is almost viciously
| misguided.
| basil-rash wrote:
| By the books, Hz is only for regular phenomena. To the extent
| human activity is a magnifying lens of underlying quantum
| activity, as is radioactive activity, Bq are better suited.
|
| It is indeed the unit of "activity", not rate.
| mytailorisrich wrote:
| Hz is for frequency, which is for periodic phenomena (1/period
| equals frequency).
|
| Usually requests to a server are not periodic, there is no
| period. They are random and follow something like the Poisson
| distribution.
|
| Requests per seconds is as SI as it gets since the second is
| the base SI unit for time.
| maxnoe wrote:
| > They are random and follow something like the Poisson
| distribution.
|
| In "stable conditions":
|
| * The number of requests in a given time interval will follow
| a poisson distribution.
|
| * The times of requests will be uniformly distributed
|
| * the duration between two consecutive requests will be
| exponentially distributed.
| AnotherGoodName wrote:
| Well si doesn't really care about distributions. So it's a gamma
| distribution with an average rate in hz. Don't bother looking for
| the distribution in the units.
| IshKebab wrote:
| This is stupid. The unit is "requests/s".
| jprival wrote:
| "rips" -> "kilorips" etc.
| prpl wrote:
| Counts per second doesn't need a unit. It's probably closer to
| flux (generic definition, not specific definition).
|
| counts per second is common in particle physics
| jameshart wrote:
| Flux is a quantity of 'something' per unit time _per unit
| 'area'_.
|
| The value of flux measurements is to be comparable across
| different scales.
|
| When looking at scaling software systems the equivalent is
| looking at 'requests per second per process', which is sort of
| a flux metric. One way to think of auto scaling is as a process
| that adjusts the number of processes to keep constant request
| flux as the overall request volume changes.
| kqr wrote:
| I like this line of thinking! We should be able to set up
| differential equations that express how traffic flows through
| the process network and solve performance like a fluid
| dynamics problem!
| lrasinen wrote:
| Feynman already did that:
| https://longnow.org/essays/richard-feynman-connection-
| machin...
|
| "By the end of that summer of 1983, Richard had completed
| his analysis of the behavior of the router, and much to our
| surprise and amusement, he presented his answer in the form
| of a set of partial differential equations."
| kqr wrote:
| Understanding how that could possibly have worked is one
| of the goals of my long-lived side quest of learning CFD.
| rollcat wrote:
| I propose that we shall use bananas as the unit for request rate
| (one banana = one request per second); it's obviously appropriate
| as:
|
| 1. Bananas are the de-facto standard for measuring the relative
| size of things posted online. Request rate is a relative
| quantity, since requests can have varying payload sizes, transfer
| rates, or server-side resource usage, even within the context of
| a single service (unlike decay rate, which to my understanding is
| usually considered within the context of a uniform sample of
| radioactive material).
|
| 2. The web has been steadily turning more toxic over the past
| several decades; you could call it a form of decay, but all
| radioactive decay eventually produces stable elements; no such
| trend has been observed with the web.
|
| 3. While bananas can trip up radiation detectors, they are much
| more likely to just go bad - same with web requests on your
| server; if you can't process them in a timely manner, better just
| throw them away.
| jbandela1 wrote:
| I think 1 banana should be 16 requests per second.
|
| This is because a banana has around 12 - 18 Becquerels of
| radiation. 16 is a nice power of 2 number.
| trklausss wrote:
| Americans will use any unit of measure but SI units... /s
| ThrowawayTestr wrote:
| SI derived units are still SI.
| notfish wrote:
| The foot is defined as exactly 0.3048 meters, does that
| mean it's an SI unit?
| nyrikki wrote:
| No, while the Mendenhall order 1893 defined all US
| customary units off of the Metric system, in SI "Derived
| units" are defined as products of powers of the base
| units.
|
| If you look at section 2.3.4 in the link below you will
| notice that there are no scalars in those derived units.
|
| They will all have the form:
|
| x^n * y^m * z^o
|
| Also note how they define a 'degree Celsius' which is
| equivalent to a degree K, but then invoke a T_0 to
| include it to avoid breaking the above rule.
|
| https://www.bipm.org/documents/20126/41483022/SI-
| Brochure-9-...
| Tomte wrote:
| Tell them that the only patriotic measurement unit is a
| gun, specifically the American M16.
|
| Since there are multiple versions, we use the latest and
| greatest: the M16A4. It is 39.97 inches long.
|
| That's what American distances and lengths are measured in!
| I'm 1.9 M16s tall!
|
| After a while we swap M16 for meters, since the M16 is not
| only 39.97in, but also -quelle surprise!- exactly one meter
| long.
| erik_seaberg wrote:
| Bananas are a measure of complexity dating back to the Jargon
| File. E.g., you could easily persuade a trained monkey to fix a
| one-banana problem.
| mci wrote:
| How about a third unit, baud [1]? It looks no worse than hertz to
| me:
|
| In telecommunication and electronics, baud (/bo:d/; symbol: Bd)
| is a common unit of measurement of symbol rate, which is one of
| the components that determine the speed of communication over a
| data channel. It is the unit for symbol rate or modulation rate
| in symbols per second or pulses per second.
|
| [1] https://en.wikipedia.org/wiki/Baud
| mytailorisrich wrote:
| Baud is indeed symbols per second.
|
| For a server, requests per seconds is the best SI unit you can
| do. In practice requests to a server are random so there is no
| periodicity and all periodic/frequency-related units do not
| apply.
| zokier wrote:
| Wikipedia has short section for this
|
| > Aperiodic frequency is the rate of incidence or occurrence of
| non-cyclic phenomena, including random processes such as
| radioactive decay. It is expressed with the unit of reciprocal
| second (s-1)[14] or, in the case of radioactivity,
| becquerels.[15]
|
| > It is defined as a rate, f = N/Dt, involving the number of
| entities counted or the number of events happened (N) during a
| given time duration (Dt);[citation needed] it is a physical
| quantity of type temporal rate.
|
| https://en.wikipedia.org/wiki/Frequency#Aperiodic_frequency
| leeoniya wrote:
| mechanical watches use a weird vibrations per hour. so instead of
| 4hz you get an unintuitive but impressive 28,800vph
|
| https://en.m.wikipedia.org/wiki/Vibrations_per_hour
| nyrikki wrote:
| Easier solution which increases your chance of being compatible
| with the rest of the world:
|
| Just use the ECMAScript Language Specification's Time-related
| Constants algorithms like SecFromTime (t)
|
| https://tc39.es/ecma262/#sec-time-related-constants
|
| Even the draft of w3c's High Resolution Time just incorporate
| them.
|
| https://www.w3.org/TR
|
| The ECMAScript Language Specification algorithms will help with
| rounding
|
| SI allows for Quotients of SI units using either a solidus (/) or
| a negative exponent.
|
| Herz is just the reciprocal of the second, 1/s or s^-1
|
| Just as meters per second == m/s == m*s^-1
|
| 1 Hz == [?]_Cs/9,192,631,770 1 Sec == 9,192,631,770/[?]_Cs
|
| As Hertz is just a special name for s^-1 or 1/s, one can simply
| use the common prefixes and be mostly in sync with common
| standards from place like the w3c or their incorporated sources
| is far better than using SI for SI's sake.
|
| Most languages have those typedefs for their duration
| classes/methods/functions anyway. But the ECMAScript spec above
| allows you to implement one that will be inter-compatible without
| trying to invent new or use obscure units.
| jedberg wrote:
| We already have a unit: RPS. Requests per second.
| thadt wrote:
| > It should be emphasized that activity measures the source
| disintegration rate, which is not synonymous with the emission
| rate of radiation produced in it's decay. Frequently, a given
| radiation will be emitted in only a fraction of all the decays,
| so a knowledge of the decay scheme of the particular isotope is
| necessary to infer a radiation emission rate from its
| activity.[1]
|
| It's a metric for a source - not a receiver. So if we're going to
| use Becquerels, then we're really talking about needing to
| characterize the sources making the requests, not the servers
| receiving them. Which is great information to characterize, but
| still leaves us needing a metric for counting the requests seen
| vs those that are started but never reach the server.
|
| If we're still excited about doing things like people measuring
| radiation, then we could use counts per time unit. Like, counts
| per second, for example.
|
| BUT - not all requests are equal. Next up, we measure how many
| resources are consumed in serving each request. I expect my next
| system dashboard to have a metric for RES (Rontgen Equivalent
| Server).
|
| [1] Knoll, 'Radiation Detection and Measurement' (3rd Ed) p2.
| tussa wrote:
| Just because something can be counted in a fixed timeframe
| doesn't mean it makes sense to slap a Hz unit on it.
|
| What's your frequency (in Hz) of sexual intimacy?
| PeterStuer wrote:
| We alteady have time as measured in seconds. "Requests" are at
| best an ill defined concept measured as a discrete quantify. I
| see no reason to 'standardize' beyond requests per second in a
| given context imho.
| jonathrg wrote:
| There is a standard for these kinds of things, the IEC-80000 part
| 13 defines quantities related to information science and
| technology. The one that is closest to request rate is probably
| "call intensity / calling rate".
|
| https://en.wikipedia.org/wiki/ISO/IEC_80000#Part_13:_Informa...
|
| This standard doesn't get much use. Mateusz Pusz, author of the
| C++ library mp-units, recently discovered it and has incorporated
| it into v2. https://www.youtube.com/watch?v=l0rXdJfXLZc
___________________________________________________________________
(page generated 2024-02-03 23:00 UTC)