Skip to content

Commit 023c7b5

Browse files
authored
DOCSP-31020 query analysis server params (#4103)
* DOCSP-31020 query analysis server params * internal review * external rev * external review * removes note
1 parent 885de51 commit 023c7b5

File tree

2 files changed

+149
-0
lines changed

2 files changed

+149
-0
lines changed

source/reference/parameters.txt

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3572,6 +3572,143 @@ Sharding Parameters
35723572

35733573
db.adminCommand( { setParameter: 1, metadataRefreshInTransactionMaxWaitBehindCritSecMS: 400 } )
35743574

3575+
.. parameter:: queryAnalysisSamplerConfigurationRefreshSecs
3576+
3577+
.. versionadded:: 7.0
3578+
3579+
|both|
3580+
3581+
*Type*: integer
3582+
3583+
*Default*: 10
3584+
3585+
Interval that a sampler (``mongos`` or ``mongod``) refreshes its
3586+
query analyzer sample rates.
3587+
3588+
The sample rate configured by the ``configureQueryAnalyzer``
3589+
command is divided among ``mongos`` instances in the sharded cluster
3590+
or ``mongod`` instances in the replica set based on the traffic going
3591+
through them. To make the sample rate assignment for a ``mongos`` or
3592+
``mongod`` more responsive to the traffic going through it, decrease
3593+
this value.
3594+
3595+
We recommend using the default value.
3596+
3597+
This example sets ``queryAnalysisSamplerConfigurationRefreshSecs`` to
3598+
60 seconds at startup on a ``mongod`` instance:
3599+
3600+
.. code-block:: bash
3601+
3602+
mongod --setParameter queryAnalysisSamplerConfigurationRefreshSecs=60
3603+
3604+
This example sets ``queryAnalysisSamplerConfigurationRefreshSecs`` to
3605+
60 seconds at startup on a ``mongos`` instance:
3606+
3607+
.. code-block:: bash
3608+
3609+
mongos --setParameter queryAnalysisSamplerConfigurationRefreshSecs=60
3610+
3611+
``queryAnalysisSamplerConfigurationRefreshSecs`` may only be set at
3612+
startup.
3613+
3614+
.. parameter:: queryAnalysisWriterIntervalSecs
3615+
3616+
.. versionadded:: 7.0
3617+
3618+
|mongod-only|
3619+
3620+
*Type*: integer
3621+
3622+
*Default*: 90
3623+
3624+
Interval that sampled queries are written to disk, in seconds.
3625+
3626+
This example sets ``queryAnalysisWriterIntervalSecs`` to
3627+
60 seconds at startup on a ``mongod`` instance:
3628+
3629+
.. code-block:: bash
3630+
3631+
mongod --setParameter queryAnalysisWriterIntervalSecs=60
3632+
3633+
``queryAnalysisWriterIntervalSecs`` may only be set at startup.
3634+
3635+
.. parameter:: queryAnalysisWriterMaxMemoryUsageBytes
3636+
3637+
.. versionadded:: 7.0
3638+
3639+
|mongod-only|
3640+
3641+
*Type*: integer
3642+
3643+
*Default*: 100 * 1024 * 1024
3644+
3645+
Maximum amount of memory in bytes that the query sampling writer is
3646+
allowed to use. Once the limit is reached, all new queries and diffs
3647+
are discarded from sampling until the buffer is flushed. Must be
3648+
greater than ``0``.
3649+
3650+
This example sets ``queryAnalysisWriterMaxMemoryUsageBytes`` to
3651+
``10000000`` at startup on a ``mongod`` instance:
3652+
3653+
.. code-block:: bash
3654+
3655+
mongod --setParameter queryAnalysisWriterMaxMemoryUsageBytes=10000000
3656+
3657+
.. parameter:: queryAnalysisWriterMaxBatchSize
3658+
3659+
.. versionadded:: 7.0
3660+
3661+
|mongod-only|
3662+
3663+
*Type*: integer
3664+
3665+
*Default*: 100000
3666+
3667+
Maximum number of sampled queries to write to disk at once. Must be
3668+
greater than ``0`` and less than or equal to ``100000``.
3669+
3670+
This example sets ``queryAnalysisWriterMaxBatchSize`` to
3671+
``1000`` at startup on a ``mongod`` instance:
3672+
3673+
.. code-block:: bash
3674+
3675+
mongod --setParameter queryAnalysisWriterMaxBatchSize=1000
3676+
3677+
During run time, you can also set the parameter with the
3678+
:dbcommand:`setParameter` command:
3679+
3680+
.. code-block:: javascript
3681+
3682+
db.adminCommand( { setParameter: 1, queryAnalysisWriterMaxBatchSize: 1000 } )
3683+
3684+
.. parameter:: queryAnalysisSampleExpirationSecs
3685+
3686+
.. versionadded:: 7.0
3687+
3688+
|mongod-only|
3689+
3690+
*Type*: integer
3691+
3692+
*Default*: 7 * 24 * 3600
3693+
3694+
Amount of time that a sampled query document exists before
3695+
being removed by the TTL monitor, in seconds. Must be greater
3696+
than ``0``.
3697+
3698+
This example sets ``queryAnalysisSampleExpirationSecs`` to
3699+
``691200`` (``8 * 24 * 3600``) at startup on a ``mongod`` instance:
3700+
3701+
.. code-block:: bash
3702+
3703+
mongod --setParameter queryAnalysisSampleExpirationSecs=691200
3704+
3705+
During run time, you can also set the parameter with the
3706+
:dbcommand:`setParameter` command:
3707+
3708+
.. code-block:: javascript
3709+
3710+
db.adminCommand( { setParameter: 1, queryAnalysisSampleExpirationSecs: 691200 } )
3711+
35753712

35763713
.. parameter:: readHedgingMode
35773714

source/release-notes/7.0.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,18 @@ MongoDB 7.0 adds the :parameter:`oidcIdentityProviders` parameter which allows
196196
you to specify identity provider (IDP) configurations when using
197197
:ref:`OpenID Connect <authentication-oidc>` authentication.
198198

199+
configureQueryAnalysis-related Parameters
200+
`````````````````````````````````````````
201+
202+
MongoDB 7.0 adds the following parameters related to the
203+
``configureQueryAnalysis`` command:
204+
205+
- :parameter:`queryAnalysisSamplerConfigurationRefreshSecs`
206+
- :parameter:`queryAnalysisWriterIntervalSecs`
207+
- :parameter:`queryAnalysisWriterMaxMemoryUsageBytes`
208+
- :parameter:`queryAnalysisWriterMaxBatchSize`
209+
- :parameter:`queryAnalysisSampleExpirationSecs`
210+
199211
Security
200212
-------------
201213

0 commit comments

Comments
 (0)