User's Guide
Reference Manual
Release Notes
PDF
Top

System Architecture Support Libraries (SASL)
Reference Manual
Version 2.6.1

Expand All
Contract All

Table of Contents

- sasl (App)
- alarm_handler
  - Top of manual page
  - clear_alarm/1
  - get_alarms/0
  - set_alarm/1
- overload
  - Top of manual page
  - request/0
  - get_overload_info/0
- rb
  - Top of manual page
  - filter/1
  - filter/2
  - grep/1
  - h/0
  - help/0
  - list/0
  - list/1
  - log_list/0
  - log_list/1
  - rescan/0
  - rescan/1
  - show/0
  - show/1
  - start/0
  - start/1
  - start_log/1
  - stop/0
  - stop_log/0
- release_handler
  - Top of manual page
  - check_install_release/1
  - check_install_release/2
  - create_RELEASES/4
  - install_file/2
  - install_release/1
  - install_release/2
  - make_permanent/1
  - remove_release/1
  - reboot_old_release/1
  - set_removed/1
  - set_unpacked/2
  - unpack_release/1
  - which_releases/0
  - which_releases/1
  - upgrade_app/2
  - downgrade_app/2
  - downgrade_app/3
  - upgrade_script/2
  - downgrade_script/3
  - eval_appup_script/4
- systools
  - Top of manual page
  - make_relup/3
  - make_relup/4
  - make_script/1
  - make_script/2
  - make_tar/1
  - make_tar/2
  - script2boot/1
- appup
- rel
- relup
- script

# overload

### MODULE

overload

### MODULE SUMMARY

An Overload Regulation Process

### DESCRIPTION

overload is a process that indirectly regulates the CPU usage in the system. The idea is that a main application calls function request/0 before starting a major job and proceeds with the job if the return value is positive; otherwise the job must not be started.

overload is part of the SASL application and all configuration parameters are defined there.

A set of two intensities are maintained, the total intensity and the accept intensity. For that purpose, there are two configuration parameters, MaxIntensity and Weight; both are measured in 1/second.

Then total and accept intensities are calculated as follows. Assume that the time of the current call to request/0 is T(n) and that the time of the previous call was T(n-1).

- The current total intensity, denoted TI(n), is calculated according to the formula

  TI(n) = exp(-Weight*(T(n) - T(n-1)) * TI(n-1) + Weight,

  where TI(n-1) is the previous total intensity.

- The current accept intensity, denoted AI(n), is determined by the formula

  AI(n) = exp(-Weight*(T(n) - T(n-1)) * AI(n-1) + Weight,

  where AI(n-1) is the previous accept intensity, if the value of exp(-Weight*(T(n) - T(n-1)) * AI(n-1) is less than MaxIntensity. Otherwise the value is

  AI(n) = exp(-Weight*(T(n) - T(n-1)) * AI(n-1)

The value of configuration parameter Weight controls the speed with which the calculations of intensities react to changes in the underlying input intensity. The inverted value of Weight, T = 1/Weight, can be thought of as the "time constant" of the intensity calculation formulas. For example, if Weight = 0.1, a change in the underlying input intensity is reflected in total intensity and accept intensity within about 10 seconds.

The overload process defines one alarm, which it sets using alarm_handler:set_alarm(Alarm). Alarm is defined as follows:

{overload, []}

  This alarm is set when the current accept intensity exceeds MaxIntensity.

A new request is not accepted until the current accept intensity has fallen below MaxIntensity. To prevent the overload process from generating many set/reset alarms, the alarm is not reset until the current accept intensity has fallen below 75% of MaxIntensity; it is not until then that the alarm can be set again.

### EXPORTS

request() -> accept | reject

Returns accept or reject depending on the current value of the accept intensity.

The application calling this function is to proceed with the job in question if the return value is accept; otherwise it is not to continue with that job.

get_overload_info() -> OverloadInfo

Types:

OverloadInfo = [{total_intensity, TotalIntensity}, {accept_intensity, AcceptIntensity}, {max_intensity, MaxIntensity}, {weight, Weight}, {total_requests, TotalRequests}, {accepted_requests, AcceptedRequests}].
TotalIntensity = float() > 0
AcceptIntensity = float() > 0
MaxIntensity = float() > 0
Weight = float() > 0
TotalRequests = integer()
AcceptedRequests = integer()

Returns:

- Current total and accept intensities
- Configuration parameters
- Absolute counts of the total number of requests
- Accepted number of requests (since the overload process was started)

### See Also

alarm_handler(3), sasl(6)