github / freno

freno: cooperative, highly available throttler service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assign explicit thresholds for apps

shlomi-noach opened this issue · comments

Specific apps may require different thresholds. These must be equal or smaller than store thresholds (store threshold are the maximum allowed threashold in a system).

Lower thresholds may impose poor man's prioritization: an app that has a lower threshold will less likely succeed to make progress on busy time, while other apps make it through.

Explicit thresholds can take place in static config, and potentially be applied dynamically.

Alternatively, and since the incentive is for some apps to be nice to others, set a throttle-ratio to an app. Instead of 0 or 1 (non-throttled, throttled, respectively), set a number [0..1] where:

  • 0: non throttled
  • 1: fully throttled
  • 0.5: half throttled (every other request gets denied)
  • etc. 0.9 would get 9/10 requests denied.

Implementing this would be very simple via naive coin flipping, ie just randomizing the response:

if random() < throttle_ratio then return 417 (StatusExpectationFailed)