Netflix / concurrency-limits

Apache License 2.0
3.25k stars 311 forks source link

Add ability for AIMDLimit to grow by a configurable amount #147

Open IgorPerikov opened 5 years ago

IgorPerikov commented 5 years ago

When AIMD works in conjunction with windowed limit, it might be way too careful in growing back after bursty spike (and, therefore, a backoff), because it has to proceed window size requests, before increasing limit by 1

My proposal is to add new method to AIMDLimit Builder, e.g.

public AIMDLimit.Builder growBy(int amount)

defaulting to 1 (current behavior)

IgorPerikov commented 5 years ago

@elandau any thoughts?

IgorPerikov commented 4 years ago

also, it looks like when combined with windowed, it might not work well with bursty load

because of this condition https://github.com/Netflix/concurrency-limits/blob/5ae2be4fea9848af6f63c7b5632af30c494e7373/concurrency-limits-core/src/main/java/com/netflix/concurrency/limits/limit/AIMDLimit.java#L98 during lower load, limit won't grow, but previously this limit could've been pessimised and there has to be some mechanism to try to increase it

am I thinking in a right direction? How to deal with bursty load in that situation? I assume some sort of queueing should be applied then, but am I missing something crucial?

Maybe just smaller window size would solve that 🤔