Skip to content

es circuit breaker#1484

Merged
dragos-rebegea merged 7 commits intodevelopmentfrom
API-561-api-es-circuit-breaker
Apr 23, 2025
Merged

es circuit breaker#1484
dragos-rebegea merged 7 commits intodevelopmentfrom
API-561-api-es-circuit-breaker

Conversation

@bogdan-rosianu
Copy link
Copy Markdown
Contributor

Reasoning

  • if the underlying elasticsearch service is under high load, we should limit the number of requests we send

Proposed Changes

  • added a proxy/wrapper over the elastic search handler that will apply the circuit breaker pattern over it.
  • in case requests take longer than normally expected, we should block further incoming requests towards es until the response time decreases

How to test

@bogdan-rosianu bogdan-rosianu self-assigned this Apr 11, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 11, 2025

k6 load testing comparison.
Base Commit Hash: a383889
Target Commit Hash: ac458b0

Metric Base Target Diff
AvgMax9095AvgMax9095AvgMax9095
Mex46.30199.6350.3852.2645.68607.6149.8051.35-1.34% ✅+204.37% 🔴-1.16% ✅-1.73% ✅
Transactions61.652499.4551.2753.9461.073883.1350.5352.94-0.94% ✅+55.36% 🔴-1.45% ✅-1.86% ✅
Tokens46.99594.2750.4252.2645.86503.8049.7851.29-2.40% ✅-15.22% ✅-1.28% ✅-1.87% ✅
Accounts47.39889.7450.3052.2546.871343.3249.6851.15-1.11% ✅+50.98% 🔴-1.23% ✅-2.12% ✅
Pool46.87465.7750.4052.1745.84515.1849.8351.38-2.20% ✅+10.61% 🔴-1.13% ✅-1.52% ✅
Blocks54.031414.5950.8953.5352.331385.6850.2552.34-3.15% ✅-2.04% ✅-1.26% ✅-2.22% ✅
Nodes46.67289.4950.4052.2547.051584.9149.9351.75+0.81% 🔴+447.48% 🔴-0.95% ✅-0.96% ✅
Test Run Duration60001.8760003.36

Legend: Avg - Average Response Time, Max - Maximum Response Time, 90 - 90th Percentile, 95 - 95th Percentile
All times are in milliseconds.

@bogdan-rosianu bogdan-rosianu marked this pull request as ready for review April 16, 2025 14:03
this.enabled = apiConfigService.isElasticCircuitBreakerEnabled();
this.config = apiConfigService.getElasticCircuitBreakerConfig();
this.logger.log(`ES Circuit Breaker. Enabled: ${this.enabled}. Duration threshold: ${this.config.durationThresholdMs}ms.
FailureCountThreshold: ${this.config.failureCountThreshold}ms. FailureCountThreshold: ${this.config.failureCountThreshold}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failureCountThreshold value is applied multiple times

@dragos-rebegea dragos-rebegea merged commit eb0234a into development Apr 23, 2025
6 checks passed
@dragos-rebegea dragos-rebegea deleted the API-561-api-es-circuit-breaker branch April 23, 2025 10:27
dragos-rebegea added a commit that referenced this pull request Apr 23, 2025
@dragos-rebegea dragos-rebegea restored the API-561-api-es-circuit-breaker branch April 23, 2025 10:28
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

Successfully merging this pull request may close these issues.

5 participants