Loading...
Loading...
Compare original and translation side by side
maxIdleTimeMSTotal = (minPoolSize + 2) × replica members × app instancesmaxIdleTimeMS总连接数 = (minPoolSize + 2) × 副本集成员数 × 应用实例数maxPoolSize: 50maxPoolSize: 50Pool Size ≈ (Ops/sec) × (Avg duration) + 10-20% buffer(10,000 ops/sec) × (10ms) + 20% buffer = 120 connections10 instances × 5 connections × 3 servers = 150 connections连接池大小 ≈ (每秒操作数) × (平均操作耗时) + 10-20%的缓冲空间(10000次操作/秒) × (10ms) + 20%缓冲 = 120个连接10个实例 × 5个连接 × 3个服务节点 = 150个连接connections.currentreferences/monitoring-guide.mdnet.maxIncomingConnectionsconnections.currentreferences/monitoring-guide.mdnet.maxIncomingConnections| Parameter | Value | Reasoning |
|---|---|---|
| 3-5 | Each serverless function instance has its own pool |
| 0 | Prevent maintaining unused connections. Increase to mitigate cold starts if needed |
| 10-30s | Release unused connections more quickly |
| >0 | Set to a value greater than the longest network latency you have to a member of the set |
| >0 | Use socketTimeoutMS to ensure that sockets are always closed |
| 参数 | 取值 | 说明 |
|---|---|---|
| 3-5 | 每个无服务器函数实例有独立的连接池 |
| 0 | 避免维护未使用的连接,如需缓解冷启动问题可适当调高 |
| 10-30s | 更快释放未使用的连接 |
| >0 | 取值需要大于到副本集成员的最长网络延迟 |
| >0 | 配置该参数确保套接字总会被关闭 |
| Parameter | Value | Reasoning |
|---|---|---|
| 50+ | Based on peak concurrent requests (monitor and adjust) |
| 10-20 | Pre-warmed connections ready for traffic spikes |
| 5-10min | Stable servers benefit from persistent connections |
| 5-10s | Fail fast on connection issues |
| 30s | Prevent hanging queries; appropriate for short OLTP operations |
| 5s | Quick failover for replica set topology changes |
| 参数 | 取值 | 说明 |
|---|---|---|
| 50+ | 基于并发请求峰值设置(监控运行情况后调整) |
| 10-20 | 预热连接,应对流量突增 |
| 5-10min | 稳定服务受益于持久化连接 |
| 5-10s | 连接出现问题时快速失败 |
| 30s | 避免查询挂起;适合短耗时的OLTP操作 |
| 5s | 副本集拓扑变更时快速故障转移 |
| Parameter | Value | Reasoning |
|---|---|---|
| 10-20 | Fewer concurrent operations. Match your expected concurrent analytical operations |
| 0-5 | Queries are infrequent; minimal pre-warming needed |
| >0 | Set socketTimeoutMS to two or three times the length of the slowest operation that the driver runs. |
| 10min | Minimize connection churn while not keeping truly idle connections too long. Consider the timeouts of intermediate network devices |
| 参数 | 取值 | 说明 |
|---|---|---|
| 10-20 | 并发操作较少,匹配预期的并发分析操作数即可 |
| 0-5 | 查询频率低,仅需要少量预热连接 |
| >0 | 取值设置为驱动运行的最慢操作耗时的2-3倍 |
| 10min | 尽量减少连接波动,同时避免长期保留完全空闲的连接,需要考虑中间网络设备的超时设置 |
| Parameter | Value | Reasoning |
|---|---|---|
| 100+ | Higher ceiling to accommodate sudden traffic spikes |
| 20-30 | More pre-warmed connections ready for immediate bursts |
| 2 (default) | Prevent thundering herd during sudden demand |
| 2-5s | Fail fast when pool exhausted rather than queueing indefinitely |
| 5min | Balance between reuse during bursts and cleanup between spikes |
| 参数 | 取值 | 说明 |
|---|---|---|
| 100+ | 更高的上限以应对突发流量峰值 |
| 20-30 | 更多预热连接,可即时应对流量突增 |
| 2(默认值) | 避免流量突增时的惊群效应 |
| 2-5s | 连接池耗尽时快速失败,避免无限排队 |
| 5min | 在突增期连接复用和峰值间隔清理之间取得平衡 |
references/monitoring-guide.mdreferences/monitoring-guide.mdMongoWaitQueueTimeoutErrorWaitQueueTimeoutErrorMongoTimeoutExceptionmaxPoolSizeMongoWaitQueueTimeoutErrorWaitQueueTimeoutErrorMongoTimeoutExceptionmaxPoolSizeconnectTimeoutMSsocketTimeoutMSconnectTimeoutMSsocketTimeoutMSconnections.totalCreatedmaxIdleTimeMSconnections.totalCreatedmaxIdleTimeMSminPoolSizecompressors: ['snappy', 'zlib']minPoolSizecompressors: ['snappy', 'zlib']references/monitoring-guide.mdreferences/monitoring-guide.md