Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Percentage Based Error Thresholds #245

Open
michaelkipper opened this issue Jul 2, 2019 · 1 comment
Open

Feature Request: Percentage Based Error Thresholds #245

michaelkipper opened this issue Jul 2, 2019 · 1 comment

Comments

@michaelkipper
Copy link

What

Currently, we express error thresholds as the number of failures (error_threshold) in a certain time period (error_timeout). After that threshold is reached, we open the circuit, and only close it again after a certain number of successful requests (success_threshold) are reached.

This requires intimate knowledge of your request patterns. A more flexible model is to use an error percentage threshold to determine when to open the circuit. Instead of saying 3 failures in 5 seconds, one might say over 10% of requests failed.

How

Either add a new parameter, error_percent_threshold or allow error_threshold to be expressed as a percentage (e.g. "10%").

Maintain either a large sliding window of successes and errors to compute percentages, or perhaps a set of counters to reduce the overall size of the windows.

@thegedge
Copy link

thegedge commented Jul 4, 2019

This requires intimate knowledge of your request patterns

On top of that, it also assumes a happy path. I like a percentage threshold because it could adapt to a shift in traffic that wasn't anticipated (e.g., flash sale). This would work well with our current setup where bulkheads trip circuits, because bulkhead timeouts are more likely during high RPS, which in turn makes it more likely that we'd open circuits in high traffic situations (which may not be desirable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants