MongoDB settings
When creating or editing a Managed Service for MongoDB cluster, you can specify settings that pertain to MongoDB.
The label next to the setting name helps determine which interface is used to set the value of this setting: the management console, CLI, API, or API.
Depending on the selected interface, the same setting will be represented differently. For example, Max incoming connections in the management console is the same as:
max_incoming_connections
in gRPC or the CLImaxIncomingConnections
in the REST API
In a sharded cluster, some settings are only available to certain host roles.
How settings depend on the host class
The values of some MongoDB settings can be automatically adjusted when you change the host class:
- If the values were not specified or are not suitable for the new class, the default settings for this class will be applied.
- If the settings you specified manually are suitable for the new class, they will not change.
The settings that depend on the host class are:
Cluster-level DBMS settings
-
Net
All interfaces
Networking settings.
-
Max incoming connections
Maximum number of inbound connections.
The minimum value is
10
. The maximum value depends on the selected host class and is equal to the host's RAM volume in MB, with a maximum of16384
. Default value:1024
.For more information, see Connection limits.
-
Compression → Compressors
Lists the compression methods that a host with the
MONGOD
orMONGOS
role can use to compress network messages. The order of the listing is important.The
disabled
value disables compression. Default value:snappy,zstd,zlib
.For more information, see the MongoDB documentation
.
-
-
Operation profiling
All interfaces
Note
These settings are not available for hosts with the
MONGOS
role in a sharded cluster.DBMS profiler settings. The profiler collects query data and then uses it to determine a query optimization strategy.
-
Mode
DBMS profiler mode:
off
: Profiling disabled.slowOp
(default): Only collects information about slow operations (that take longer than the threshold value specified in the Slow op threshold setting).all
: Collects information about all queries in progress.
For more information, see the MongoDB documentation
. -
Slow op sample rate
The number of slow operations to profile or log. If enabled, this parameter affects diagnostic logging and the profiler.
Minimum value:
0
; maximum value:1
; default:1
.For more information, see the MongoDB documentation
. -
Slow op threshold
Sets the operation execution time (in milliseconds). If exceeded, the operation is considered slow.
Minimum value:
0
; maximum value:36000000
(10 hours); default:300
.For more information, see the MongoDB
documentation.
-
-
Set parameter
-
Enable flow control
All interfaces
Decides whether or not to control the rate of primary host's write operations. Enabling this parameter ensures that the "majority commited" metric for replica hosts will not exceed the pre-configured value of 10 seconds.
Default value:
false
(flow control disabled).For more information, see the MongoDB documentation
. -
Min snapshot history window in seconds
All interfaces
Note
This setting is available for hosts with the
MONGOD
role only.Time, in seconds, for snapshot history to be retained.
Possible values: from zero up. Default value:
60
. Increasing this setting value increases disk usage.For more information, see the MongoDB documentation
.
-
-
Storage
All interfaces
Note
This setting is unavailable for hosts with the
MONGOS
role in a sharded cluster.Hosts with the
MONGOCFG
role only have the Engine config → Cache size gb setting available.Settings that define how MongoDB works with the storage
.-
Journal → Commit interval
The interval in milliseconds between when MongoDB journal data
is written to disk.Minimum value:
1
; maximum value:500
; default:300
.For more information, see the MongoDB documentation
. -
Wired tiger
Settings for the storage engine
:-
Collection config → Block compressor
Data compression option. The value set here only applies to new collections. You can also redefine it for individual collections
and indexes .none
: Compression disabled.snappy
: Use the snappy library for data compression. If you select this setting, data compression/decompression will be, in most cases, faster than if using thezlib
library; however, the resulting file size will be 20% to 100% larger.zlib
: Use the zlib library for data compression. This method is slower thansnappy
but, in most cases, it achieves better data compression.
For more information, see the MongoDB documentation
. -
Engine config → Cache size gb
Maximum size of the internal cache used for data storage (in GB). This setting does not affect the amount of RAM used to create an index.
Minimum value:
0.25
(256 MB). The maximum and default values depend on the selected host class and are determined by these formulas:- Maximum value:
0.9 × <host_RAM_amount>
. - Default value:
0.5 × <host_RAM_amount>
.
For example, for s1.medium (8 vCPU, 32 GB) class hosts, the maximum value is
28.8
and the default value is16
.For more information, see the MongoDB documentation
. - Maximum value:
-
Index config → Prefix compression
Enables or disables prefix compression for indexes. Changing the parameter only affects new indexes, not the existing ones.
Default value:
true
(prefix compression enabled).For more information, see the MongoDB documentation
.
-
-