userver: MONGO_CONNECTION_POOL_SETTINGS
Loading...
Searching...
No Matches
MONGO_CONNECTION_POOL_SETTINGS

MONGO_CONNECTION_POOL_SETTINGS Dynamic Config

Options for MongoDB connections pool (uservices) for service. This options replace static config. When using MultiMongo all pools are updated.

Dictionary keys can be either the service component name (not database name!) or __default__. The latter configuration is applied for every non-matching Mongo component of the service.

Schema:

# yaml
default: {}
description: |
Options for MongoDB connections pool (uservices) for service.
This options replace static config.
When using MultiMongo all pools are updated.
Dictionary keys can be either the service **component name** (not database name!)
or `__default__`. The latter configuration is applied for every non-matching
Mongo component of the service.
schema:
type: object
example: |
{
// Options for specified component.
"mongo-stq_config": {
"initial_size": 32,
"max_size": 256,
"idle_limit": 128,
"connecting_limit": 8
},
// Default options. Applied to all not specified components.
"__default__": {
"initial_size": 16,
"max_size": 128,
"idle_limit": 64,
"connecting_limit": 8
}
}
properties:
__default__:
$ref: "#/definitions/PoolSettings"
additionalProperties:
$ref: "#/definitions/PoolSettings"
definitions:
PoolSettings:
type: object
additionalProperties: false
properties:
initial_size:
type: integer
minimum: 0
default: 16
description: number of connections created initially.
max_size:
type: integer
minimum: 1
default: 128
description: limit for total connections number.
idle_limit:
type: integer
minimum: 1
default: 64
description: limit for idle connections number.
connecting_limit:
type: integer
minimum: 0
default: 8
description: limit for establishing connections number.
required:
- max_size
- connecting_limit

Example:

{
// Options for specified component.
"mongo-stq_config": {
"initial_size": 32,
"max_size": 256,
"idle_limit": 128,
"connecting_limit": 8
},
// Default options. Applied to all not specified components.
"__default__": {
"initial_size": 16,
"max_size": 128,
"idle_limit": 64,
"connecting_limit": 8
}
}

For a full list of dynamic configs see Dynamic config schemas list