From 84adefa331c4159d432d22840663c38f155cd4c1 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 20 Nov 2009 14:54:40 +0000 Subject: The R13B03 release. --- lib/sasl/doc/src/overload.xml | 151 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 lib/sasl/doc/src/overload.xml (limited to 'lib/sasl/doc/src/overload.xml') diff --git a/lib/sasl/doc/src/overload.xml b/lib/sasl/doc/src/overload.xml new file mode 100644 index 0000000000..80457e75fa --- /dev/null +++ b/lib/sasl/doc/src/overload.xml @@ -0,0 +1,151 @@ + + + + +
+ + 19962009 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + overload + Peter Högfeldt + Peter Högfeldt + + (Joe Armstrong) + + 1996-10-29 + A + overload.sgml +
+ overload + An Overload Regulation Process + +

overload is a process which indirectly regulates CPU + usage in the system. The idea is that a main application calls + the request/0 function 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, the MaxIntensity + and the Weight value (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, + provided that 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 will 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, then a change in the underlying input intensity will be + reflected in the total and accept intensities within + approximately 10 seconds. +

+

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

+ + {overload, []} + +

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

+
+
+

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

+
+ + + request() -> accept | reject + Request to proceed with current job + +

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

+

The application + calling this function should be processed with the job in + question if the return value is accept; otherwise it + should not continue with that job. +

+
+
+ + get_overload_info() -> OverloadInfo + Return current overload information data + + 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 the current total and accept intensities, the + configuration parameters, and absolute counts of the total + number of requests, and accepted number of requests (since + the overload process was started).

+
+
+
+ +
+ See Also +

alarm_handler(3), sasl(3) +

+
+
+ -- cgit v1.2.3