--- title: "Transport Netty 接收缓冲区预测最小值配置" date: 2026-01-24 lastmod: 2026-01-24 description: "transport.netty.receive_predictor_min 配置项用于定义 Netty 接收缓冲区分配器的最小预测值。" tags: ["Transport", "Netty", "接收缓冲区", "性能优化"] summary: "配置项作用 # transport.netty.receive_predictor_min 配置项用于定义Netty 接收缓冲区分配器的最小预测值。 配置项属性 # 配置路径: transport.netty.receive_predictor_min 数据类型: ByteSizeValue(字节大小,支持 bytes、kb、mb、gb 单位) 默认值: 继承自 transport.netty.receive_predictor_size 的值(64KB) 是否可选: 是 作用域: NodeScope(节点级别) 动态更新: 否(需要重启节点生效) 配置建议 # 默认配置 # transport: netty: receive_predictor_min: 64kb # 默认值 固定大小配置(推荐) # transport: netty: receive_predictor_min: 64kb receive_predictor_max: 64kb # 与 min 相同时使用固定分配器 自适应缓冲区配置 # transport: netty: receive_predictor_min: 32kb receive_predictor_max: 128kb # min < max 时使用自适应分配器 注意事项 # 非动态更新: 需要重启节点生效。" --- ## 配置项作用 `transport.netty.receive_predictor_min` 配置项用于定义**Netty 接收缓冲区分配器的最小预测值**。 ## 配置项属性 - **配置路径**: `transport.netty.receive_predictor_min` - **数据类型**: `ByteSizeValue`(字节大小,支持 bytes、kb、mb、gb 单位) - **默认值**: 继承自 `transport.netty.receive_predictor_size` 的值(64KB) - **是否可选**: 是 - **作用域**: NodeScope(节点级别) - **动态更新**: 否(需要重启节点生效) ## 配置建议 ## 默认配置 ```yaml transport: netty: receive_predictor_min: 64kb # 默认值 ``` ## 固定大小配置(推荐) ```yaml transport: netty: receive_predictor_min: 64kb receive_predictor_max: 64kb # 与 min 相同时使用固定分配器 ``` ## 自适应缓冲区配置 ```yaml transport: netty: receive_predictor_min: 32kb receive_predictor_max: 128kb # min < max 时使用自适应分配器 ``` ## 注意事项 1. **非动态更新**: 需要重启节点生效。 2. **与 receive_predictor_max 配合使用**: - 当 `receive_predictor_min` 等于 `receive_predictor_max` 时,使用固定大小的缓冲区分配器 - 当两者不相等时,使用自适应缓冲区分配器 3. **建议值**: 建议设置 `min ≤ receive_predictor_size ≤ max` 4. **自适应场景**: 需要根据实际流量动态调整缓冲区大小时,可以设置 min < max