The AIMDBackoffManager applies an additive increase,
multiplicative decrease (AIMD) to managing a dynamic limit to
the number of connections allowed to a given host. You may want
to experiment with the settings for the cooldown periods and the
backoff factor to get the adaptive behavior you want.
Generally speaking, shorter cooldowns will lead to more steady-state variability but faster reaction times, while longer cooldowns will lead to more stable equilibrium behavior but slower reaction times.
Similarly, higher backoff factors promote greater utilization of available capacity at the expense of fairness among clients. Lower backoff factors allow equal distribution of capacity among clients (fairness) to happen faster, at the expense of having more server capacity unused in the short term.
| Access | Constructor and Description |
|---|---|
| public | AIMDBackoffManager(final ConnPoolControl<HttpRoute>
the connPerRoute)ConnPoolControl that manages
per-host routing maximumsConstructs an |
| Modifier and Type | Method and Description |
|---|---|
| protected int | Returns: the backed-off pool size, with a minimum value of 1the current pool size curr)Implements abstract org. |
| public void | setBackoffFactor(final double
must be between 0.0 and 1.0, exclusive. d)Implements abstract org. |
| AIMDBackoffManager | back to summary |
|---|---|
| public AIMDBackoffManager(final ConnPoolControl<HttpRoute> connPerRoute) Constructs an
This constructor is primarily used for testing purposes, allowing the
injection of a custom
| |
| getBackedOffPoolSize | back to summary |
|---|---|
| protected int getBackedOffPoolSize(final int curr) Implements abstract org. Returns the backed-off pool size based on the current pool size. The new pool size is calculated as the floor of (backoffFactor * curr).
| |
| setBackoffFactor | back to summary |
|---|---|
| public void setBackoffFactor(final double d) Implements abstract org. Sets the factor to use when backing off; the new
per-host limit will be roughly the current max times
this factor.
| |