# ElasticsearchException：索引[0]恢复因max_bytes_per_sec [40mb]被限流

- **ID:** `elasticsearch/max-bytes-per-sec-throttle`
- **领域:** elasticsearch
- **类别:** resource_error
- **验证级别:** ai_generated
- **修复率:** 78%

## 根因

分片恢复被限流，因为节点的max_bytes_per_sec设置对于当前恢复负载过低。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| elasticsearch 7.17.0 | active | — | — |
| elasticsearch 8.10.0 | active | — | — |
| elasticsearch 8.6.2 | active | — | — |

## 解决方案

1. ```
   临时增加max_bytes_per_sec：PUT _cluster/settings { "transient": { "indices.recovery.max_bytes_per_sec": "100mb" } }
   ```
2. ```
   减少并发恢复数：在elasticsearch.yml中设置indices.recovery.concurrent_streams为2以限制恢复并行度。
   ```
3. ```
   分配更多专用热节点以分散恢复负载，然后重新平衡副本。
   ```

## 无效尝试

- **** — This can saturate network bandwidth and cause other node failures, especially in clusters with many concurrent recoveries. (45% 失败率)
- **** — Restarting only resets the recovery process temporarily; throttling reapplies once recovery resumes. (70% 失败率)
- **** — Setting to 0 disables throttling but can overwhelm the node's I/O, leading to OOM or disk saturation. (65% 失败率)
