RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/AGENTS.md/grpc/grpc

AGENTS.md

src/core/load_balancing/AGENTS.md
AGENTS.md

Quality

48/100

Scores the file, not the repository.

Length

575 words

6 headings · 0 code blocks

Repository

45k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
grpc/grpc/src/core/load_balancing/AGENTS.mdRawGitHub
1# gRPC Load Balancing
2 
3This directory contains the implementation of gRPC's load balancing framework.
4 
5See also: [gRPC Client Channel overview](../client_channel/AGENTS.md)
6 
7## Overarching Purpose
8 
9The code in this directory provides a flexible and extensible framework for load balancing. It allows different load balancing policies to be plugged in to gRPC to control how RPCs are distributed across a set of backend servers.
10 
11## Core Concepts
12 
13The load balancing framework is built around a few key abstractions:
14 
15* **`LoadBalancingPolicy`**: The `LoadBalancingPolicy` is the main abstraction for load balancing in gRPC. It is responsible for creating and managing subchannels, and for deciding which subchannel to use for each RPC.
16* **`SubchannelPicker`**: The `SubchannelPicker` is a simple interface that is used to select a subchannel for a given RPC. Each `LoadBalancingPolicy` has a `SubchannelPicker` that is used to make the final routing decision.
17* **`LoadBalancingPolicyFactory`**: A `LoadBalancingPolicyFactory` is responsible for creating instances of a particular `LoadBalancingPolicy`.
18* **`LoadBalancingPolicyRegistry`**: The `LoadBalancingPolicyRegistry` is a global registry of `LoadBalancingPolicyFactory` instances. This registry is used to create `LoadBalancingPolicy` instances by name.
19 
20## Load Balancing Policies
21 
22gRPC comes with a number of built-in load balancing policies, each of which is implemented in its own subdirectory:
23 
24* **`pick_first`**: This policy tries to connect to the first address in the list, and if that fails, it tries the next one, and so on. It's the default policy if no other is specified.
25* **`round_robin`**: This policy distributes RPCs across all available backend connections in a round-robin fashion.
26* **`weighted_round_robin`**: A more advanced version of round-robin that takes into account the weights of the different backends.
27* **`ring_hash`**: This policy uses a consistent hashing algorithm to distribute RPCs across the backends. This is useful for session affinity, as it ensures that all RPCs for a given session are sent to the same backend.
28* **`grpclb`**: This policy uses an external load balancer to make load balancing decisions. The external load balancer is typically a separate process that is running on the same machine as the gRPC client.
29* **`xds`**: This policy uses the xDS protocol to configure load balancing. xDS is a set of APIs that are used to configure service discovery, load balancing, and other features in a service mesh. See the [xDS documentation](../xds/AGENTS.md) for more details.
30* **`rls`**: Route Lookup Service. This policy uses a separate service to determine the route for each RPC.
31 
32## Files
33 
34* **`lb_policy.h`, `lb_policy.cc`**: These files define the core `LoadBalancingPolicy` interface.
35* **`lb_policy_registry.h`, `lb_policy_registry.cc`**: These files define the `LoadBalancingPolicyRegistry`.
36* **`subchannel_interface.h`**: Defines the interface that a subchannel must implement to be used by a `LoadBalancingPolicy`.
37* **`child_policy_handler.h`, `child_policy_handler.cc`**: A helper class for implementing composite load balancing policies that delegate to child policies. This is used by policies like `xds` and `priority`.
38* **`address_filtering.h`, `address_filtering.cc`**: A helper class for filtering addresses based on a set of attributes. This is used by policies like `xds` to implement locality-based routing.
39* **`health_check_client.h`, `health_check_client.cc`**: A client for the gRPC health checking protocol. This is used by some LB policies to determine the health of the backends.
40 
41## Notes
42 
43* gRPC's load balancing framework is highly extensible. New load balancing policies can be added by implementing the `LoadBalancingPolicy` and `LoadBalancingPolicyFactory` interfaces and registering the factory with the `LoadBalancingPolicyRegistry`.
44* The load balancing policy is chosen based on the service config, which can be provided by the [resolver](../resolver/AGENTS.md).
45* Load balancing is primarily used in the client channel. See the [client channel documentation](../client_channel/AGENTS.md) for more details.
46 

Sections

  • gRPC Load Balancing
  • Overarching Purpose
  • Core Concepts
  • Load Balancing Policies
  • Files
  • Notes

Stack — with the evidence

swift

(1.00)

csharp

(1.00)

cpp

(1.00)

python

(0.60)

ruby

(0.60)

php

(0.60)

dotnet

(0.60)

ruff

(0.60)

github-actions

(0.60)

Format

AGENTS.md

A plain-markdown README for coding agents, deliberately unopinionated: no frontmatter, no globs, no vendor keys. That minimalism is why it became the one file a dozen different agents will read, and why it carries the least per-file targeting power of any format here.

What the corpus says about it

Repository

Owner
grpc
Language
—
License
—
Archived
no

All configs in this repo

Also in grpc/grpc

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
grpc/grpcsrc/core/ext/filters/census/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections25/1003 days ago
grpc/grpcsrc/core/ext/filters/gcp_authentication/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security44/1003 days ago
grpc/grpcsrc/core/ext/filters/http/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/ext/filters/stateful_session/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/ext/transport/chaotic_good/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections48/1003 days ago
grpc/grpcsrc/core/ext/transport/inproc/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/filter/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/handshaker/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections39/1003 days ago
grpc/grpcsrc/core/server/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/service_config/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/telemetry/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections39/1003 days ago
grpc/grpcsrc/core/transport/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections39/1003 days ago
grpc/grpcsrc/core/credentials/transport/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security39/1003 days ago
grpc/grpcsrc/core/ext/filters/backend_metrics/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections44/1003 days ago
grpc/grpcsrc/core/credentials/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security39/1003 days ago
grpc/grpcsrc/core/tsi/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security39/1003 days ago
grpc/grpcsrc/core/tsi/alts/AGENTS.md · 45kAGENTS.mdswiftcsharp+7no sections39/1003 days ago
grpc/grpcsrc/core/credentials/call/AGENTS.md · 45kAGENTS.mdswiftcsharp+7security39/1003 days ago
grpc/grpcsrc/core/ext/transport/chttp2/AGENTS.md · 45kAGENTS.mdswiftcsharp+7testarchdependencies48/1003 days ago
grpc/grpcAGENTS.md · 45kAGENTS.mdswiftcsharp+7styledependenciesdo-not54/1003 days ago
Diff against src/core/ext/filters/census/AGENTS.md Diff against src/core/ext/filters/gcp_authentication/AGENTS.md Diff against src/core/ext/filters/http/AGENTS.md Diff against src/core/ext/filters/stateful_session/AGENTS.md Diff against src/core/ext/transport/chaotic_good/AGENTS.md Diff against src/core/ext/transport/inproc/AGENTS.md Diff against src/core/filter/AGENTS.md Diff against src/core/handshaker/AGENTS.md Diff against src/core/server/AGENTS.md Diff against src/core/service_config/AGENTS.md Diff against src/core/telemetry/AGENTS.md Diff against src/core/transport/AGENTS.md Diff against src/core/credentials/transport/AGENTS.md Diff against src/core/ext/filters/backend_metrics/AGENTS.md Diff against src/core/credentials/AGENTS.md Diff against src/core/tsi/AGENTS.md Diff against src/core/tsi/alts/AGENTS.md Diff against src/core/credentials/call/AGENTS.md Diff against src/core/ext/transport/chttp2/AGENTS.md Diff against AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
vllm-project/vllmAGENTS.md · 88kAGENTS.mdpythonpytorch+3setuptestlint-formatstyle+5100/1003 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
react/react-nativepackages/react-native-compatibility-check/AGENTS.md · 126kAGENTS.mdreactreact-native+11testlint-formatstylearch+499/1003 days ago
netdata/netdatasrc/go/plugin/ibm.d/AGENTS.md · 80kAGENTS.mddockerinfrastructure+7buildtestlint-formatarch+399/1003 days ago
dragonflydb/dragonflyAGENTS.md · 31kAGENTS.mdcppredis+6setupbuildtestlint-format+1096/1002 days ago
dotnet/aspnetcoresrc/Components/AGENTS.md · 38kAGENTS.mdcsharpdotnet+5buildteststylearch+396/1003 days ago
duckdb/duckdbAGENTS.md · 40kAGENTS.mdcppswift+1buildtestlint-formatstyle+896/100today
steipete/CodexBarAGENTS.md · 20kAGENTS.mdswiftgithub-actionsbuildteststylearch+493/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack