MongoDB tips: get config information

db._adminCommand( {getCmdLineOpts: 1})
db._adminCommand({getParameter:"*"})

rs0:PRIMARY> db._adminCommand( {getCmdLineOpts: 1})
{
        "argv" : [
                "mongod",
                "--config=/data/configdb/mongod.conf",
                "--dbpath=/data/db",
                "--replSet=rs0",
                "--port=27017",
                "--bind_ip=0.0.0.0",
                "--auth",
                "--keyFile=/data/configdb/key.txt"
        ],
        "parsed" : {
                "config" : "/data/configdb/mongod.conf",
                "net" : {
                        "bindIp" : "0.0.0.0",
                        "port" : 27017
                },
                "replication" : {
                        "replSet" : "rs0"
                },
                "security" : {
                        "authorization" : "enabled",
                        "keyFile" : "/data/configdb/key.txt"
                },
                "storage" : {
                        "dbPath" : "/data/db"
                }
        },
        "ok" : 1,
        "operationTime" : Timestamp(1573759458, 1),
        "$clusterTime" : {
                "clusterTime" : Timestamp(1573759458, 1),
                "signature" : {
                        "hash" : BinData(0,"JZV+Uf9hNHnDCcsPipqhBSRJ7Xw="),
                        "keyId" : NumberLong("6758888784156164098")
                }
        }
}


rs0:PRIMARY> db._adminCommand({getParameter:"*"})
{
        "KeysRotationIntervalSec" : 7776000,
        "ShardingTaskExecutorPoolHostTimeoutMS" : 300000,
        "ShardingTaskExecutorPoolMaxConnecting" : 2,
        "ShardingTaskExecutorPoolMaxSize" : -1,
        "ShardingTaskExecutorPoolMinSize" : 1,
        "ShardingTaskExecutorPoolRefreshRequirementMS" : 60000,
        "ShardingTaskExecutorPoolRefreshTimeoutMS" : 20000,
        "TransactionRecordMinimumLifetimeMinutes" : 30,
        "adaptiveServiceExecutorIdlePctThreshold" : 60,
        "adaptiveServiceExecutorMaxQueueLatencyMicros" : 500,
        "adaptiveServiceExecutorRecursionLimit" : 8,
        "adaptiveServiceExecutorReservedThreads" : -1,
        "adaptiveServiceExecutorRunTimeJitterMillis" : 500,
        "adaptiveServiceExecutorRunTimeMillis" : 5000,
        "adaptiveServiceExecutorStuckThreadTimeoutMillis" : 250,
        "allowRolesFromX509Certificates" : true,
        "allowUnsafeRenamesDuringInitialSync" : false,
        "authSchemaVersion" : 5,
        "authenticationMechanisms" : [
                "MONGODB-CR",
                "MONGODB-X509",
                "SCRAM-SHA-1"
        ],
        "bgSyncOplogFetcherBatchSize" : 13981010,
        "clientCursorMonitorFrequencySecs" : 4,
        "clusterAuthMode" : "keyFile",
        "collectionClonerBatchSize" : -1,
        "connPoolMaxConnsPerHost" : 200,
        "connPoolMaxInUseConnsPerHost" : 2147483647,
        "connPoolMaxShardedConnsPerHost" : 200,
        "connPoolMaxShardedInUseConnsPerHost" : 2147483647,
        "cursorTimeoutMillis" : NumberLong(600000),
        "debugCollectionUUIDs" : false,
        "diagnosticDataCollectionDirectorySizeMB" : 200,
        "diagnosticDataCollectionEnabled" : true,
        "diagnosticDataCollectionFileSizeMB" : 10,
        "diagnosticDataCollectionPeriodMillis" : 1000,
        "diagnosticDataCollectionSamplesPerChunk" : 300,
        "diagnosticDataCollectionSamplesPerInterimUpdate" : 10,
        "disableJavaScriptJIT" : false,
        "disableLogicalSessionCacheRefresh" : false,
        "disableNonSSLConnectionLogging" : false,
        "disabledSecureAllocatorDomains" : [ ],
        "enableElectionHandoff" : true,
        "enableLocalhostAuthBypass" : true,
        "enableTestCommands" : false,
        "failIndexKeyTooLong" : true,
        "featureCompatibilityVersion" : {
                "version" : "3.6"
        },
        "globalConnPoolIdleTimeoutMinutes" : 2147483647,
        "heapProfilingEnabled" : false,
        "heapProfilingSampleIntervalBytes" : NumberLong(262144),
        "honorSystemUmask" : false,
        "initialSyncOplogBuffer" : "collection",
        "initialSyncOplogBufferPeekCacheSize" : 10000,
        "initialSyncOplogFetcherBatchSize" : 13981010,
        "internalDocumentSourceCursorBatchSizeBytes" : 4194304,
        "internalDocumentSourceLookupCacheSizeBytes" : 104857600,
        "internalGeoNearQuery2DMaxCoveringCells" : 16,
        "internalGeoPredicateQuery2DMaxCoveringCells" : 16,
        "internalInsertMaxBatchSize" : 64,
        "internalLookupStageIntermediateDocumentMaxSizeBytes" : NumberLong(104857600),
        "internalProhibitShardOperationRetry" : false,
        "internalQueryAlwaysMergeOnPrimaryShard" : false,
        "internalQueryCacheEvictionRatio" : 10,
        "internalQueryCacheFeedbacksStored" : 20,
        "internalQueryCacheSize" : 5000,
        "internalQueryEnumerationMaxIntersectPerAnd" : 3,
        "internalQueryEnumerationMaxOrSolutions" : 10,
        "internalQueryExecMaxBlockingSortBytes" : 33554432,
        "internalQueryExecYieldIterations" : 128,
        "internalQueryExecYieldPeriodMS" : 10,
        "internalQueryFacetBufferSizeBytes" : 104857600,
        "internalQueryForceIntersectionPlans" : false,
        "internalQueryIgnoreUnknownJSONSchemaKeywords" : false,
        "internalQueryMaxScansToExplode" : 200,
        "internalQueryPlanEvaluationCollFraction" : 0.3,
        "internalQueryPlanEvaluationMaxResults" : 101,
        "internalQueryPlanEvaluationWorks" : 10000,
        "internalQueryPlanOrChildrenIndependently" : true,
        "internalQueryPlannerEnableHashIntersection" : false,
        "internalQueryPlannerEnableIndexIntersection" : true,
        "internalQueryPlannerGenerateCoveredWholeIndexScans" : false,
        "internalQueryPlannerMaxIndexedSolutions" : 64,
        "internalQueryProhibitBlockingMergeOnMongoS" : false,
        "internalQueryProhibitMergingOnMongoS" : false,
        "internalQueryS2GeoCoarsestLevel" : 0,
        "internalQueryS2GeoFinestLevel" : 23,
        "internalQueryS2GeoMaxCells" : 20,
        "internalValidateFeaturesAsMaster" : true,
        "javascriptProtection" : false,
        "journalCommitInterval" : 0,
        "jsHeapLimitMB" : 1100,
        "localLogicalSessionTimeoutMinutes" : 30,
        "logComponentVerbosity" : {
                "verbosity" : 0,
                "accessControl" : {
                        "verbosity" : -1
                },
                "command" : {
                        "verbosity" : -1
                },
                "control" : {
                        "verbosity" : -1
                },
                "executor" : {
                        "verbosity" : -1
                },
                "geo" : {
                        "verbosity" : -1
                },
                "index" : {
                        "verbosity" : -1
                },
                "network" : {
                        "verbosity" : -1,
                        "asio" : {
                                "verbosity" : -1
                        },
                        "bridge" : {
                                "verbosity" : -1
                        }
                },
                "query" : {
                        "verbosity" : -1
                },
                "replication" : {
                        "verbosity" : -1,
                        "heartbeats" : {
                                "verbosity" : -1
                        },
                        "rollback" : {
                                "verbosity" : -1
                        }
                },
                "sharding" : {
                        "verbosity" : -1,
                        "shardingCatalogRefresh" : {
                                "verbosity" : -1
                        }
                },
                "storage" : {
                        "verbosity" : -1,
                        "journal" : {
                                "verbosity" : -1
                        }
                },
                "write" : {
                        "verbosity" : -1
                },
                "ftdc" : {
                        "verbosity" : -1
                },
                "tracking" : {
                        "verbosity" : -1
                }
        },
        "logLevel" : 0,
        "logUserIds" : false,
        "logicalSessionRefreshMillis" : 300000,
        "maxAcceptableLogicalClockDriftSecs" : NumberLong(31536000),
        "maxBSONDepth" : 200,
        "maxIndexBuildMemoryUsageMegabytes" : 500,
        "maxLogSizeKB" : 10,
        "maxNumInitialSyncCollectionClonerCursors" : 1,
        "maxSessions" : 1000000,
        "maxSyncSourceLagSecs" : 30,
        "migrateCloneInsertionBatchDelayMS" : 0,
        "migrateCloneInsertionBatchSize" : 0,
        "newCollectionsUsePowerOf2Sizes" : true,
        "notablescan" : false,
        "numInitialSyncAttempts" : 10,
        "numInitialSyncCollectionCountAttempts" : 3,
        "numInitialSyncCollectionFindAttempts" : 3,
        "numInitialSyncConnectAttempts" : 10,
        "numInitialSyncListCollectionsAttempts" : 3,
        "numInitialSyncListDatabasesAttempts" : 3,
        "numInitialSyncListIndexesAttempts" : 3,
        "numInitialSyncOplogFindAttempts" : 3,
        "opensslCipherConfig" : "",
        "opensslDiffieHellmanParameters" : "",
        "oplogFetcherInitialSyncMaxFetcherRestarts" : 10,
        "oplogFetcherSteadyStateMaxFetcherRestarts" : 1,
        "oplogInitialFindMaxSeconds" : 60,
        "oplogRetriedFindMaxSeconds" : 2,
        "orphanCleanupDelaySecs" : 900,
        "periodicNoopIntervalSecs" : 10,
        "priorityTakeoverFreshnessWindowSeconds" : 2,
        "quiet" : false,
        "rangeDeleterBatchDelayMS" : 20,
        "rangeDeleterBatchSize" : 0,
        "replApplyBatchSize" : 1,
        "replBatchLimitOperations" : 5000,
        "replElectionTimeoutOffsetLimitFraction" : 0.15,
        "replIndexPrefetch" : "all",
        "replWriterThreadCount" : 16,
        "reportOpWriteConcernCountersInServerStatus" : false,
        "reservedServiceExecutorRecursionLimit" : 8,
        "rollbackRemoteOplogQueryBatchSize" : 2000,
        "saslHostName" : "mongodb-replicaset-0",
        "saslServiceName" : "mongodb",
        "saslauthdPath" : "",
        "scramIterationCount" : 10000,
        "scriptingEngineInterruptIntervalMS" : 1000,
        "shardedConnPoolIdleTimeoutMinutes" : 2147483647,
        "skipCorruptDocumentsWhenCloning" : false,
        "skipShardingConfigurationChecks" : false,
        "sslMode" : "disabled",
        "sslWithholdClientCertificate" : false,
        "startupAuthSchemaValidation" : true,
        "suppressNoTLSPeerCertificateWarning" : false,
        "syncdelay" : 60,
        "synchronousServiceExecutorRecursionLimit" : 8,
        "taskExecutorPoolSize" : 0,
        "tcmallocAggressiveMemoryDecommit" : 0,
        "tcmallocEnableMarkThreadTemporarilyIdle" : false,
        "tcmallocMaxTotalThreadCacheBytes" : NumberLong(1073741824),
        "testingSnapshotBehaviorInIsolation" : false,
        "traceExceptions" : false,
        "traceWriteConflictExceptions" : false,
        "ttlMonitorEnabled" : true,
        "ttlMonitorSleepSecs" : 60,
        "waitForSecondaryBeforeNoopWriteMS" : 10,
        "wiredTigerConcurrentReadTransactions" : 128,
        "wiredTigerConcurrentWriteTransactions" : 128,
        "wiredTigerCursorCacheSize" : -100,
        "wiredTigerEngineRuntimeConfig" : "",
        "wiredTigerSessionCloseIdleTimeSecs" : 300,
        "writePeriodicNoops" : true,
        "ok" : 1,
        "operationTime" : Timestamp(1573759598, 1),
        "$clusterTime" : {
                "clusterTime" : Timestamp(1573759598, 1),
                "signature" : {
                        "hash" : BinData(0,"3ED6v9wOyZO+/wzuRN47jENFPpk="),
                        "keyId" : NumberLong("6758888784156164098")
                }
        }
}


After you see this value, you can modify some of the runtime value as well, but make sure you know what you are doing before you go down this path to start tweaking mongodb's preset values.

EX:
rs0:PRIMARY> db.adminCommand({setParameter:1, "wiredTigerConcurrentReadTransactions":200})
{
        "was" : 128,
        "ok" : 1,
        "operationTime" : Timestamp(1573760178, 1),
        "$clusterTime" : {
                "clusterTime" : Timestamp(1573760178, 1),
                "signature" : {
                        "hash" : BinData(0,"l5Tk9DilkR4FKxzwrClFeQyAQ5o="),
                        "keyId" : NumberLong("6758888784156164098")
                }
        }
}
rs0:PRIMARY> db.adminCommand({getParameter:1, "wiredTigerConcurrentReadTransactions":1})
{
        "wiredTigerConcurrentReadTransactions" : 200,
        "ok" : 1,
        "operationTime" : Timestamp(1573760188, 1),
        "$clusterTime" : {
                "clusterTime" : Timestamp(1573760188, 1),
                "signature" : {
                        "hash" : BinData(0,"BIgC1jvgVeSFlZ3GVtrgkgZnwdc="),
                        "keyId" : NumberLong("6758888784156164098")
                }
        }
}


Comments

Popular posts from this blog

MongoDB tip: 4 ways to modify replica set configuration

MongoDB Quick Note: BI Connector Issue

MongoDB Tips: Kill long running processes