1. 程式人生 > >mongos-sharding連接池配置

mongos-sharding連接池配置

con cross num 進行 for executor mongos ren emp

ShardingTaskExecutorPoolMaxSize

Maximum number of outbound connections each TaskExecutor connection pool can open to any given mongod instance. 
The maximum possible connections to any given host across all TaskExecutor pools is

連接池最大大小,默認沒有限制
對於mongod最大連接控制:ShardingTaskExecutorPoolMaxSize * taskExecutorPoolSize

ShardingTaskExecutorPoolMinSize

Minimum number of outbound connections each TaskExecutor connection pool can open to any given mongod instance.

連接池最小大小,默認為1

taskExecutorPoolSize

The number of Task Executor connection pools to use for a given mongos. 
The parameter has a minimum value of 4 and a maximum value of 64.

任務池大小,默認是cpu核數

ShardingTaskExecutorPoolMaxConnecting

Maximum number of simultaneous initiating connections (including pending connections in setup/refresh state) 
each TaskExecutor connection pool can have to a mongod instance. You can set this parameter to control 
the rate at which mongos adds connections to a mongod instance.

並發進行初始連接的數量,默認沒有限制,該值保持在ShardingTaskExecutorPoolMaxSize以下

ShardingTaskExecutorPoolRefreshRequirementMS

Maximum time the mongos waits before attempting to heartbeat a resting connection in the pool.

連接池保活心跳的間隔時間,默認1分鐘

ShardingTaskExecutorPoolRefreshTimeoutMS

Maximum time the mongos waits for a heartbeat before timing out the heartbeat

連接池保活心跳的超時時間,默認20秒

ShardingTaskExecutorPoolHostTimeoutMS

Maximum time that mongos goes without communication to a host before mongos drops all connections to the host.

空閑時間閾值,默認30秒,當mongos與mongod在指定時間內沒有交互時會釋放連接。

參考文檔
https://docs.mongodb.com/v3.4/reference/parameters/#param.ShardingTaskExecutorPoolMaxSize

mongos-sharding連接池配置