Circuit Breaker¶
Automatic protection against failing hosts.
How It Works¶
If a host stops responding (multiple timeouts or errors), FastHTTP automatically stops sending requests to that host temporarily.
What It Protects Against¶
- Flooding a failed service with requests
- Wasting resources on non-working hosts
- Cascading failures
Behavior¶
- Host experiences multiple failures
- Circuit breaker opens
- Requests to that host are blocked
- After waiting period, FastHTTP checks if host recovered
- If recovered, normal operation resumes
Configuration¶
Circuit breaker is enabled by default. You can disable it:
Logging¶
When circuit breaker activates:
Best Practices¶
- Keep security enabled
- Monitor logs for circuit breaker events
- Implement proper error handling in handlers