2
$\begingroup$

I have to implement a limitation algorithm in order to avoid to reach a throughput limit imposed by the service I'm interacting with.

The limit is specified as «N request over 1 day» where N is of the order of magnitude of 10^6.

I have a distributed system of clients interacting with the service so they should share the measure.

An exact solution should involve to record all the events and than computing the limit «when» the event of calling the service occur: of course this approach is too expensive and so I'm looking for an approximate solution.

The first one I devised imply to discretize the detection of the events: for example maintaing 24 counters at most and recording the number of requests occurred within an hour.

Acceptable.

But I feel that a more elegant, even if leaded by different «forces», is to declinate the approach to the continuum.

Let's say recording the last N events I could easily infer the «current» throughput. Of course this algorithm suffer for missing consideration of the past events occurred the hours before. I could improve with with an aging algorithm but… and here follow my question:

Q: «There's an elegant approximate solution to the problem of estimating the throughput of a service?»

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.