D
D
Daniel Demidko2019-06-23 09:28:02
Algorithms
Daniel Demidko, 2019-06-23 09:28:02

How to calculate the uptime of an asynchronous server?

There is a formula for calculating uptime in percent, 100 - (downtime / totaltime) * 100where totaltime - all the time of work, downtime - time while the server was unavailable.
And if the server is asynchronous, for example:
1. In one second, the server received two requests and began to process them in parallel
2. One of the requests was successful, and the second one took an unacceptably long time and the client did not receive a response.
How to apply the uptime calculation formula in this case?
UPD:
In my case, by the word uptime, I mean the percentage of availability.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Syomka Gavrilenko, 2019-06-23
@DanielDemidko

In your case, the formula is:
sum of successful requests \(sum of successful + sum of unsuccessful) * 100%

G
Griboks, 2019-06-23
@Griboks

Is there a service time somewhere in this formula? Downtime - the time the server was down. Uptime - when enabled. Errors are not taken into account by this indicator.

V
Valentine, 2019-06-23
@vvpoloskin

There is the concept of accessibility (what you counted). There are some quality parameters (for example, % errors). So the degradation of quality parameters is not the unavailability of the service.

T
TyzhSysAdmin, 2019-06-23
@POS_troi

Log errors, process the log and consider what is needed.
You can immediately shove the entire statue into prometheus, etc. if there are backend sources, or from nginx via lua, or even 100500 more options, in short, monitor all errors and count as you please.

W
Wexter, 2019-06-23
@Wexter

Uptime is the time since launch. You want to calculate statistics on requests, so you need to use the metrics of all requests and "unsuccessful" requests, and actually substitute them into the formula

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question