[Feature] Add weighted load balancing support for RPC providers
@DaMandal0rian 已经在做这个了。
开始于 2025年8月14日。
评估
这个 Issue 还没有评估数据。
描述
Problem
Currently, Graph Node uses a sequential failover approach for RPC providers. It attempts to use the first configured provider and only moves to the next provider if there are issues or if a required feature is not available. This means traffic is not distributed across providers - instead, the first healthy provider handles all requests until it fails.
This limitation prevents operators from:
- Distributing load across multiple healthy RPC endpoints
- Utilizing all available RPC capacity efficiently
- Preventing single provider overload when multiple endpoints are available
- Optimizing costs by balancing requests across providers with different pricing
- Achieving true high availability through active load distribution
Proposed Solution
Implement weighted random load balancing for RPC provider selection, allowing operators to configure traffic distribution percentages for each endpoint.
Example Use Cases
- Performance-based routing: Direct 80% of traffic to a high-performance dedicated node and 20% to a backup
- Cost optimization: Route 90% to cheaper endpoints and 10% to premium endpoints for critical requests
- Gradual rollout: Start a new provider at 5% traffic and increase as confidence grows
- Capacity management: Distribute load according to each endpoint's actual capacity
Implementation
I've created PR #[YOUR_PR_NUMBER] that adds this functionality with:
- Configurable decimal weights (0.0-1.0) per RPC provider
- New
--weighted-rpc-steeringCLI flag and config option - Backward compatibility (defaults to equal weights when not specified)
- Weighted random selection algorithm for provider choice
Configuration Example
[chains.mainnet]
weighted_rpc_steering = true
provider = [
{
label = "primary-node",
details = { type = "web3", url = "https://fast.example.com", weight = 0.7 }
},
{
label = "secondary-node",
details = { type = "web3", url = "https://medium.example.com", weight = 0.2 }
},
{
label = "backup-node",
details = { type = "web3", url = "https://backup.example.com", weight = 0.1 }
}
]
Related Work
- PR - Implementation of weighted load balancing
- This addresses a common request for managing multiple RPC endpoints with varying characteristics
Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.
No response
Some information to help us out
- Tick this box if you plan on implementing this feature yourself.
- I have searched the issue tracker to make sure this issue is not a duplicate.
- 主要语言
- Rust
- 星标
- 3.2k
- 派生
- 1.1k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
graphprotocol/graph-node 的其他 Issue
-
current: include emits an all-null bucket for dimensionless aggregations, nulling the whole response未关闭
难度 2/5 1-3 小时 新手友好度 78/100
graphprotocol/graph-node#6719 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
graphprotocol/graph-node#6673 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
graphprotocol/graph-node#6650 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
graphprotocol/graph-node#6722 ·
-
难度 3/5 1-2 天 新手友好度 68/100
graphprotocol/graph-node#6721 ·
查看 graphprotocol/graph-node 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
HigherOrderCO/Bend#1294 ·
-
chore P0
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
todo:ticket
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
docs: CLAUDE.md version banner shows 1.4.0 instead of 1.5.0 (recurring drift, root cause unresolved)未关闭awaiting-response backend bug documentation enhancement P2 platform/linux qa safety
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 84/100
tauri-apps/window-vibrancy#230 ·