52 Commits

Author SHA1 Message Date
Bright Chen e24461e353 Refactor NULL with nullptr in docs (#3467) 2026-08-19 23:11:50 +08:00
rajvarun77 32c95225e8 Add Power-of-Two-Choices Peak-EWMA load balancer (p2c) (#3367)
* Add Power-of-Two-Choices Peak-EWMA load balancer (p2c)

Implements the p2c load balancing policy proposed in #3340: each
selection samples two random servers (configurable via choices=N) and
routes to the lower peak-EWMA latency * (inflight+1) / weight score.
Upward latency spikes take effect immediately while recovery decays
over tau_ms (default 10s), so a degraded server is shed within one
observation at O(1) selection cost.

Uses only existing LoadBalancer hooks (SelectServer/Feedback,
need_feedback) with DoublyBufferedData membership like rr/la; per-node
stats are shared_ptr-owned by both buffers. Registered as "p2c" in
global.cpp. Includes unit tests (functional, weighted, exclusion,
error punishment, concurrency churn) and docs in cn/en client.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Reuse SelectIn.begin_time_us to avoid extra clock read per selection

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Address review: gflags for tunables, cap error punishment, drop FlatMap init

- p2c_default_choices/p2c_default_tau_ms gflags as channel-overridable defaults
- p2c_max_punish_ms(default 30s) caps the doubled-EWMA error punishment so a
  persistently failing server recovers in bounded time after turning healthy
- Servers::server_map relies on FlatMap small-map auto-init
- tests: error_punish_is_capped + feedback_lock_overhead benchmark

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: rajvarun77 <287367605+rajvarun77@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:41:54 +08:00
Jenrry You a103b4b6f5 Prevent indefinite defer-close by checking last_active_time (#3216)
Co-authored-by: youzhiyuan <youzhiyuan@bytedance.com>
2026-03-10 16:00:23 +08:00
Menci 4b14951862 Add client ALPN support (#2251)
* Add client ALPN support

* Fix build error

* Remove ALPN code from mesalink_ssl_helper

* Add alpn_protocol.size() to error message

* Add docs
2023-12-25 11:52:48 +08:00
Xiaofeng Wang 0eb6a79f28 update project links (#2200)
- brpc/brpc -> apache/brpc
2023-04-11 09:48:46 +08:00
yyweii 7a8b49b4b3 add nacos naming service (#1922) 2022-09-16 18:43:14 +08:00
372046933 c1dc6e8e86 Update client.md (#1767) 2022-05-26 18:14:19 +08:00
wangweibing 5759810cc0 Update client doc about channel destruction 2021-11-17 02:29:47 +00:00
wangweibing f075023785 Improve client en doc 2021-09-15 04:08:49 +00:00
wangweibing 32ba62d10b Fix en http client doc 2021-07-26 02:22:15 +00:00
Zhangyi Chen 9716e26ff2 Merge pull request #1314 from serverglen/weighted_randomized
implement weighted randomized load balancer #1254
2021-07-02 22:56:56 +08:00
serverglen 9c1b4532b9 implement weighted randomized load balancer 2020-12-26 23:09:06 +08:00
serverglen 3e6b5aa930 update client.md file naming-service demo machine list 2020-09-28 11:05:01 +08:00
jamesge 122770d377 Remove desc. on default values of connection_timeout_ms from docs 2019-08-09 05:44:11 -07:00
Ge Jun e5279adaa9 Unify callings of http protocols 2019-06-19 05:20:15 +01:00
zhujiashun e7db73878e refine docs for cluster recover 2019-04-19 17:47:48 +08:00
zhujiashun 2ce30e8266 add en docs for cluster recover 2019-04-19 13:58:51 +08:00
zhujiashun 67ff7f1f13 add docs for cluster recover & fix parameter unit 2019-04-19 12:10:16 +08:00
Ge Jun 283ca7e0ea minor changes 2018-09-30 10:10:33 +01:00
Ge Jun 56360e41ce Fix a minor spelling 2018-09-30 10:05:02 +01:00
Ge Jun 2d496fa5b5 rename grpc to gRPC 2018-09-30 10:00:23 +01:00
Ge Jun 23dbd69342 Add h2/grpc docs 2018-09-30 09:46:22 +01:00
zhujiashun 4812754331 Make StreamCreator be member of Call to make retry and backup request work 2018-09-26 15:53:15 +08:00
Ge Jun 74abadbee8 Update docs on NS tags 2018-09-17 09:05:26 +01:00
gejun f912f0db02 Update SSL related docs 2018-09-08 22:23:09 +08:00
zyearn 0b4117d81a Polish docs/{en,cn}/client.md 2018-08-23 21:25:14 +08:00
gejun 2ae7f04ce5 Make comments on max_connection_pool_size more accurate 2018-08-05 15:23:52 +08:00
Ge Jun d6514e82a5 add newlines to some docs 2018-07-04 14:01:49 +08:00
Ge Jun a1692d9aed more docs on naming service 2018-07-04 13:55:14 +08:00
Ge Jun 1b865a8905 Merge pull request #307 from brpc/jiangrujie-dev
Add docs & Fix SSL UT
2018-04-26 14:28:50 +08:00
old-bear c8b7aa8115 + Minor fix and guard on SSL 2018-04-24 14:18:31 +08:00
Ge Jun 680538df38 Merge pull request #293 from ZhangYaoFu/consul_naming_service
为consul名字服务添加文档
2018-04-18 14:13:40 +08:00
zhangyaofu a315ea4291 update consul naming service en doc 2018-04-17 21:44:02 +08:00
zhangyaofu 093267487a update consul naming service doc 2018-04-17 19:04:47 +08:00
old-bear 716674a1c1 + Update docs for SSL 2018-04-13 22:02:05 +08:00
zhangyaofu 4f7830ecad update doc for consul naming service 2018-04-04 14:31:06 +08:00
caidj cb54b42e19 add wrr
add weighted round robin
2018-03-22 07:24:28 +00:00
ZX Xu 491290a303 Update client.md
`cntl` is not a pointer here
2018-01-23 12:44:57 +08:00
gejun 83c55dceb2 misc changes to docs 2017-11-21 13:58:35 +08:00
old-bear fd012a55a7 Translate client authentication part in client.md 2017-11-10 09:24:04 +08:00
gejun 6038ff903a Add entry README in Chinese 2017-11-01 19:43:06 +08:00
Zhangyi Chen 4e9929205c Add number of worker pthreads stuff into client.md 2017-10-11 20:55:09 +08:00
gejun d098ad75e8 Add mutual links to cn/en in client.md 2017-09-29 00:25:09 +08:00
gejun fbb588d949 describe -http_body_compress_threshold in docs 2017-09-28 13:50:32 +08:00
gejun c9039fd42b Complete translation of client.md 2017-09-18 20:39:59 +08:00
gejun 31949b48ba More translations in client.md 2017-09-18 00:27:50 +08:00
gejun c3ae57a09f Fixes on docs and comments 2017-09-14 17:10:56 +08:00
gejun 31958a76df Point code links to github 2017-09-14 11:58:23 +08:00
gejun 89a311c3f4 more translations in client.md 2017-09-14 11:48:59 +08:00
gejun 28bcc04d20 more translations in client.md 2017-09-13 19:18:53 +08:00