1. Home
  2. Документы
  3. MicroPVR
  4. Launch and use
  5. Load balancing

Load balancing

MicroPVR contains the API method is_alivedesigned to monitor server congestion based on an overall load assessment, or score.

score it is calculated as the sum of estimates of network load, sessions and average CPU computing resource load. Each estimate is calculated as

(N/N_max) * 10.0

where

N is the current parameter value
N_max - maximum

Also, if the maximum value of any of the parameters is set at -1, then its estimate will always be zero.

is_alive return falsely if at least one estimate exceeds the value of 8.0 (similar to the achievement of the parameter of 80% of the specified maximum value, for example, more than 800 Mbps of outgoing network stream with a maximum of 1000 Mbps) or if the value is exceeded score value specified in the parameter score-max-score.

The load calculation uses the following parameters:

  • max-net-load — downloading outbound network stream to Mbit/sec.
  • max-sessions — maximum of the number of current incoming TCP sessions and the number of content requests per N seconds, where N is regulated by the parameter monitor-request-lifetime.
  • max-cpu-la1 8212: The average load of computing resources, also known as the load average. This option should be distinguished from the processor load.

The current load average can be determined by the team uptime utilities top. The optimal value of this parameter can vary greatly depending on the type of load and the number of computing cores.

These parameters measure the overall state of the server, not just the MicroPVR software.