Exponential backoff is an algorithm that uses feedback to multiplicatively decrease the rate of some process, in order to gradually find an acceptable rate. These algorithms find usage in a wide range of systems and processes, with wireless networks and computer networks being particularly notable.
Exponential backoff algorithm An exponential backoff algorithm is a form of closed-loop control system that reduces the rate of a controlled process in response to adverse events. For example, if a mobile app fails to connect to its server, the mobile app might try again 1 second later, then if it fails again, 2 seconds later, then 4, etc. Each time, the pause is multiplied by a fixed amount (in this case, 2). In this case, the adverse event is failing to connect to the server. Other examples of adverse events include collisions of network traffic, packet loss, an error response from a service, or an explicit request to reduce the rate (i.e., back off). The rate reduction can be modelled as an exponential function:
t=bc or
f=1bc Here, t is the time delay applied between actions, b is the multiplicative factor or base, and c is the number of adverse events observed. Alternatively, f is the frequency (or rate) of the process (i.e., number of actions per unit of time). The value of c is incremented each time an adverse event is observed, leading to an exponential rise in delay and, therefore, an inversely proportionate rate. An exponential backoff algorithm where b = 2 is referred to as a binary exponential backoff algorithm. When the rate has been reduced in response to an adverse event, it usually does not remain at that reduced level forever. If no adverse events are observed for some period of time, often referred to as the recovery time or cooling-off period, the rate may be increased again. The time period that must elapse before attempting to increase the rate again may, itself, be determined by an exponential backoff algorithm. Typically, recovery of the rate occurs more slowly than reduction of the rate due to backoff and often requires careful tuning to avoid oscillation of the rate. The exact recovery behaviour is implementation-specific and may be informed by any number of environmental factors. The mechanism by which rate reduction is achieved in a system may be more complex than a simple time delay. In some cases, the value t may refer to an upper bound on the time delay, rather than a specific time delay value. The name exponential backoff refers to the exponential growth characteristic of the backoff, rather than an exact numeric relationship between adverse event counts and delay times.
Rate limiting Exponential backoff is commonly utilised as part of rate limiting mechanisms in computer systems such as web services, to help enforce fair distribution of access to resources and prevent network congestion. Each time a service informs a client that it is sending requests too frequently, the client reduces its rate by some predetermined factor until the client's request rate reaches an acceptable equilibrium. The service may enforce rate limiting by refusing to respond to requests when the client is sending them too frequently, so that misbehaving clients are not allowed to exceed their allotted resources. A benefit of utilising an exponential backoff algorithm over a fixed rate limit is that rate limits through exponential backoff can be achieved dynamically without providing any prior information to the client. In the event that resources are unexpectedly constrained, e.g., due to heavy load or a service disruption, backoff requests and error responses from the service can automatically decrease the request rate from clients. This can help maintain some level of availability rather than overloading the service. In addition, quality of service can be prioritised to certain clients based on their individual importance, e.g., by reducing the backoff for emergency calls on a telephone network during periods of high load. In a simple version of the algorithm, messages are delayed by a predetermined (non-random) time. For example, in SIP protocol over unreliable transport (such as UDP) the client retransmits requests at an interval that starts at T1 seconds (usually 500 ms, which is the estimate of the round-trip time) and doubles after every retransmission until it reaches T2 seconds (which defaults to 4 s). This results in retransmission intervals of 500 ms, 1 s, 2 s, 4 s, 4 s then 4 s.
… excerpt ends here. Continue reading the full article.