feat(auto_cl): add error rate threshold for punishment attenuation (#3219)
* feat(auto_cl): add error rate threshold for punishment attenuation
Add new GFlag `auto_cl_error_rate_punish_threshold` to enable
error-rate-based punishment attenuation in AutoConcurrencyLimiter.
Problem: Low error rates (e.g., 1.3% sporadic timeouts) cause
disproportionate avg_latency inflation (+31%), leading the limiter
to mistakenly shrink max_concurrency and trigger ELIMIT rejections.
Solution: Inspired by Alibaba Sentinel's threshold-based approach:
- threshold=0 (default): Original behavior preserved (backward compat)
- threshold>0 (e.g., 0.1): Error rates below threshold produce zero
punishment; above it, punishment scales linearly from 0 to full
Example: With threshold=0.1, a 5% error rate produces no punishment,
while a 50% error rate produces 44% of the original punishment.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
4 files changed
tree: f1d780861e624314946874f3dde3c50f1b2d89aa
- .github/
- bazel/
- cmake/
- community/
- docs/
- example/
- homebrew-formula/
- java/
- package/
- python/
- src/
- test/
- tools/
- .asf.yaml
- .bazelignore
- .bazelrc
- .bazelversion
- .gitignore
- .licenserc.yaml
- BUILD.bazel
- CHANGES.md
- CMakeLists.txt
- CODE_OF_CONDUCT.md
- config.h.in
- config_brpc.sh
- CONTRIBUTING.md
- Dockerfile
- LICENSE
- Makefile
- MODULE.bazel
- NOTICE
- README.md
- README_cn.md
- RELEASE_VERSION
- WORKSPACE
- WORKSPACE.bzlmod
README.md
中文版


bRPC is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc.
“bRPC” means “better RPC”.
You can use it to:
- Build a server that can talk in multiple protocols (on same port), or access all sorts of services
- restful http/https, h2/gRPC. using http/h2 in bRPC is much more friendly than libcurl. Access protobuf-based protocols with HTTP/h2+json, probably from another language.
- redis and memcached, thread-safe, more friendly and performant than the official clients.
- rtmp/flv/hls, for building streaming services.
- hadoop_rpc (may be opensourced)
- rdma support
- thrift support, thread-safe, more friendly and performant than the official clients.
- all sorts of protocols used in Baidu: baidu_std, streaming_rpc, hulu_pbrpc, sofa_pbrpc, nova_pbrpc, public_pbrpc, ubrpc and nshead-based ones.
- Build HA distributed services using an industrial-grade implementation of RAFT consensus algorithm which is opensourced at braft
- Servers can handle requests synchronously or asynchronously.
- Clients can access servers synchronously, asynchronously, semi-synchronously, or use combo channels to simplify sharded or parallel accesses declaratively.
- Debug services via http, and run cpu, heap and contention profilers.
- Get better latency and throughput.
- Extend bRPC with the protocols used in your organization quickly, or customize components, including naming services (dns, zk, etcd), load balancers (rr, random, consistent hashing)
Try it!
Contribute code
Please refer to here.
Feedback and Getting involved
Code of Conduct
We follow the code of conduct from Apache Software Foundation, please refer it here Link