Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
136a95c
feat: ETS-backed LB with per-request pick, remove persistent_term wri…
cgreeno Apr 23, 2026
9b58997
chore: drop benchee dep and bench/lb_pick.exs from LB PR
cgreeno Apr 23, 2026
1ddd9ec
fix(lb): prevent pick/1 from crashing callers when the table is gone
cgreeno Apr 23, 2026
48b9975
test(connection): cover lb_mod.shutdown on disconnect and terminate
cgreeno Apr 23, 2026
6bba30f
docs(connection): drop references to the removed :refresh timer
cgreeno Apr 23, 2026
292d958
test(connection): restore the real persistent_term shape in already_s…
cgreeno Apr 23, 2026
d98c474
fix(lb): prevent PickFirst from going stale after DNS re-resolution
cgreeno Apr 23, 2026
88b3de1
refactor: swap persistent_term for a shared ETS registry
cgreeno Apr 23, 2026
1f5d7e8
test(registry): direct unit coverage for put/lookup/delete
cgreeno Apr 23, 2026
b3b0d98
test(connection): cover pick_channel races with disconnect
cgreeno Apr 23, 2026
189f46e
test(connection): assert no ETS leaks across 500 connect/disconnect c…
cgreeno Apr 23, 2026
43c98d2
test(re_resolve): cover pick races with a reconcile that shrinks back…
cgreeno Apr 23, 2026
dbab947
fix(lb): make update/2 required; remove broken init/1 fallback
cgreeno Apr 23, 2026
06ad6be
refactor(lb): drop shutdown/1, let BEAM reclaim ETS; stop Connection …
cgreeno Apr 23, 2026
f543e1a
docs: tighten comments on EXIT handler and PickFirst moduledoc
cgreeno Apr 23, 2026
9537b64
fix(connection): keep Registry consistent across init, reconcile, dis…
cgreeno Apr 24, 2026
d1be507
docs: tighten comments on Registry ordering and pick race
cgreeno Apr 28, 2026
648f80d
fix(connection): re-init resolver in place, don't stop the Connection
cgreeno Apr 28, 2026
4ab3008
Merge branch 'master' into feature/ets-lb-pick-path
cgreeno Apr 30, 2026
5334433
fix: erase persistent_term leak in GRPC.Client.Connection on disconnect
cgreeno Apr 30, 2026
38a032e
docs: aggressive comment cleanup, match #520 style
cgreeno May 1, 2026
b4b7f21
Merge branch 'master' into feature/ets-lb-pick-path
cgreeno May 5, 2026
9eb3a75
Merge remote-tracking branch 'origin/master' into feature/ets-lb-pick…
May 13, 2026
8af2f5f
test(dns_resolver): disconnect channel at end of failing-channels test
cgreeno May 13, 2026
4f39740
Merge remote-tracking branch 'origin/master' into feature/ets-lb-pick…
cgreeno May 15, 2026
9511bf3
Merge branch 'master' into feature/ets-lb-pick-path
sleipnir May 28, 2026
6609f8f
fix: robust direct-target host parsing, restore :no_addresses contract
cgreeno Jun 1, 2026
b49668a
Merge branch 'master' into feature/ets-lb-pick-path
cgreeno Jun 15, 2026
78e5c76
Merge branch 'master' into feature/ets-lb-pick-path
sleipnir Jun 15, 2026
4d2f981
Merge branch 'master' into feature/ets-lb-pick-path
sleipnir Jun 15, 2026
84f5fa9
Merge branch 'master' into feature/ets-lb-pick-path
cgreeno Jun 16, 2026
4827a2e
Merge branch 'master' into feature/ets-lb-pick-path
cgreeno Jun 19, 2026
1084ec6
docs: note round-robin per-pick cost in README and LB guide
cgreeno Jun 23, 2026
4a02b05
Merge branch 'master' into feature/ets-lb-pick-path
sleipnir Jun 23, 2026
dc6d7d7
test: fix flaky DNSTest log-bleed across async tests
cgreeno Jun 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions grpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ iex> {:ok, channel} = GRPC.Stub.connect("unix:/tmp/my.sock")
>__NOTE__: When using `DNS` or `xDS` targets, the connection layer periodically refreshes endpoints.
---

## Performance characteristics

Round-robin balancing makes a real routing decision on every RPC, so each pick
costs a little more than talking to a single static address — roughly **~290 ns
added per pick** in exchange for genuine per-request distribution across
backends. The pick path is lock-free (an ETS read plus an `:atomics` counter,
no table- or key-level lock), so it scales with concurrency and stays well
above any realistic per-connection RPC rate. Workloads that only ever talk to a
single endpoint can use `:pick_first` to skip the rotation cost entirely.

See [#527](https://github.com/elixir-grpc/grpc/pull/527) for detailed benchmarks.

## Compression and Metadata

You can specify message compression and attach default headers to all requests.
Expand Down
14 changes: 13 additions & 1 deletion grpc/guides/advanced/load_balancing.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,16 @@ iex> {:ok, channel} = GRPC.Stub.connect("unix:/tmp/my.sock")

>__Note__: When using `DNS` target, the connection layer periodically refreshes endpoints.

---
---

## Performance characteristics

Round-robin balancing makes a real routing decision on every RPC, so each pick
costs a little more than talking to a single static address — roughly **~290 ns
added per pick** in exchange for genuine per-request distribution across
backends. The pick path is lock-free (an ETS read plus an `:atomics` counter,
no table- or key-level lock), so it scales with concurrency and stays well
above any realistic per-connection RPC rate. Workloads that only ever talk to a
single endpoint can use `:pick_first` to skip the rotation cost entirely.

See [#527](https://github.com/elixir-grpc/grpc/pull/527) for detailed benchmarks.
Loading
Loading