# Open-source NGINX module providing adaptive circuit breaker behavior using real-time upstream error rates.

**URL:** <https://community.nginx.org/t/open-source-nginx-module-providing-adaptive-circuit-breaker-behavior-using-real-time-upstream-error-rates/9723>\
**Category:** Community Showcase\
**Tags:** performance, module, code, reverse-proxy\
**Created:** [June 15, 2026, 11:25am UTC](https://community.nginx.org/t/open-source-nginx-module-providing-adaptive-circuit-breaker-behavior-using-real-time-upstream-error-rates/9723 "2026-06-15T11:25:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rootmese](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/rootmese/32/4526_2.png) [@rootmese](https://community.nginx.org/u/rootmese)\
**Post date:** [June 15, 2026, 11:25am UTC](https://community.nginx.org/t/open-source-nginx-module-providing-adaptive-circuit-breaker-behavior-using-real-time-upstream-error-rates/9723/1 "2026-06-15T11:25:44Z")

</div>

Hi everyone,

I’ve been working on an open-source NGINX dynamic module called Traction Control Module, designed to protect upstream services from overload and cascading failures.

Unlike traditional rate limiting, the module continuously evaluates upstream health using a sliding-window error rate and automatically adjusts traffic handling based on observed service degradation.

The module transitions through multiple states:

Normal → Warning → Critical (429) → Emergency (503) → Recovery

Features:

• Lock-free atomic counters  
• Shared memory across workers  
• Independent zones per service/upstream  
• Sliding-window health scoring  
• Progressive traffic shedding  
• Native NGINX phase integration  
• Monitoring endpoint

Example use cases:

• Protecting APIs during partial outages  
• Preventing cascading failures  
• Reducing retry storms  
• Graceful degradation of overloaded services

Example configuration:

location /api {  
traction\_control zone=backend;  
traction\_warning\_action rate\_limit=30%;  
proxy\_pass [http://upstream](http://upstream);  
}

The goal is not to replace limit\_req or upstream health checks, but to provide adaptive protection based on real-time error rates observed by NGINX.

The project is currently in beta and I’d appreciate feedback from the community, especially regarding architecture, operational behavior, and real-world use cases.

GitHub:

> **[GitHub - rootmese/nginx\_circuit\_breaker: Adaptive NGINX module that prevents cascading...](https://github.com/rootmese/nginx_circuit_breaker)**
>
> Adaptive NGINX module that prevents cascading failures using real-time error-rate feedback.

Feedback and suggestions are welcome.

Best regards,

Alessandro Silveira
