mongodb查看当前的存储引擎

 ./mongo -port 27001
MongoDB shell version v3.4.4
connecting to: mongodb://127.0.0.1:27001/
MongoDB server version: 3.4.4
shard1:ARBITER> use admin
switched to db admin
shard1:ARBITER> db.serverStatus()
{
	"host" : "dzswj_mongodb_db3:27001",
	"version" : "3.4.4",
	"process" : "mongod",
	"pid" : NumberLong(8708),
	"uptime" : 28954736,
	"uptimeMillis" : NumberLong("28954736154"),
	"uptimeEstimate" : NumberLong(28954736),
	"localTime" : ISODate("2019-01-07T06:09:36.622Z"),
	"asserts" : {
		"regular" : 0,
		"warning" : 0,
		"msg" : 0,
		"user" : 3,
		"rollovers" : 0
	},
	"connections" : {
		"current" : 3,
		"available" : 816,
		"totalCreated" : 39
	},
	"extra_info" : {
		"note" : "fields vary by platform",
		"page_faults" : 0
	},
	"globalLock" : {
		"totalTime" : NumberLong("28954736152000"),
		"currentQueue" : {
			"total" : 0,
			"readers" : 0,
			"writers" : 0
		},
		"activeClients" : {
			"total" : 13,
			"readers" : 0,
			"writers" : 0
		}
	},
	"locks" : {
		"Global" : {
			"acquireCount" : {
				"r" : NumberLong(101338161),
				"w" : NumberLong(16),
				"W" : NumberLong(4)
			}
		},
		"Database" : {
			"acquireCount" : {
				"r" : NumberLong(65146419),
				"R" : NumberLong(1),
				"W" : NumberLong(16)
			}
		},
		"Collection" : {
			"acquireCount" : {
				"r" : NumberLong(36191719)
			}
		},
		"Metadata" : {
			"acquireCount" : {
				"w" : NumberLong(1)
			}
		},
		"oplog" : {
			"acquireCount" : {
				"r" : NumberLong(28954700)
			}
		}
	},
	"network" : {
		"bytesIn" : NumberLong("4676480292"),
		"bytesOut" : NumberLong("11604564500"),
		"physicalBytesIn" : NumberLong("4676480292"),
		"physicalBytesOut" : NumberLong("11604564500"),
		"numRequests" : NumberLong(57734301)
	},
	"opLatencies" : {
		"reads" : {
			"latency" : NumberLong(0),
			"ops" : NumberLong(0)
		},
		"writes" : {
			"latency" : NumberLong(0),
			"ops" : NumberLong(0)
		},
		"commands" : {
			"latency" : NumberLong(1266325607),
			"ops" : NumberLong(28867150)
		}
	},
	"opcounters" : {
		"insert" : 0,
		"query" : 1,
		"update" : 0,
		"delete" : 0,
		"getmore" : 0,
		"command" : 28867150
	},
	"opcountersRepl" : {
		"insert" : 0,
		"query" : 0,
		"update" : 0,
		"delete" : 0,
		"getmore" : 0,
		"command" : 0
	},
	"repl" : {
		"hosts" : [
			"92.12.76.13:27001",
			"92.12.76.14:27001"
		],
		"arbiters" : [
			"92.12.76.15:27001"
		],
		"setName" : "shard1",
		"setVersion" : 1,
		"ismaster" : false,
		"secondary" : false,
		"primary" : "92.12.76.14:27001",
		"arbiterOnly" : true,
		"me" : "92.12.76.15:27001",
		"lastWrite" : {
			"opTime" : {
				"ts" : Timestamp(1546841373, 95),
				"t" : NumberLong(11)
			},
			"lastWriteDate" : ISODate("2019-01-07T06:09:33Z")
		},
		"rbid" : 734455356
	},
	"storageEngine" : {
		"name" : "wiredTiger",
		"supportsCommittedReads" : true,
		"readOnly" : false,
		"persistent" : true
	},
	"tcmalloc" : {
		"generic" : {
			"current_allocated_bytes" : 60554520,
			"heap_size" : 73261056
		},
		"tcmalloc" : {
			"pageheap_free_bytes" : 2949120,
			"pageheap_unmapped_bytes" : 6811648,
			"max_total_thread_cache_bytes" : NumberLong(1073741824),
			"current_total_thread_cache_bytes" : 878808,
			"total_free_bytes" : 2945768,
			"central_cache_free_bytes" : 269456,
			"transfer_cache_free_bytes" : 1797504,
			"thread_cache_free_bytes" : 878808,
			"aggressive_memory_decommit" : 0,
			"formattedString" : "------------------------------------------------\nMALLOC:       60554520 (   57.7 MiB) Bytes in use by application\nMALLOC: +      2949120 (    2.8 MiB) Bytes in page heap freelist\nMALLOC: +       269456 (    0.3 MiB) Bytes in central cache freelist\nMALLOC: +      1797504 (    1.7 MiB) Bytes in transfer cache freelist\nMALLOC: +       878808 (    0.8 MiB) Bytes in thread cache freelists\nMALLOC: +      1302720 (    1.2 MiB) Bytes in malloc metadata\nMALLOC:   ------------\nMALLOC: =     67752128 (   64.6 MiB) Actual memory used (physical + swap)\nMALLOC: +      6811648 (    6.5 MiB) Bytes released to OS (aka unmapped)\nMALLOC:   ------------\nMALLOC: =     74563776 (   71.1 MiB) Virtual address space used\nMALLOC:\nMALLOC:            762              Spans in use\nMALLOC:             22              Thread heaps in use\nMALLOC:           4096              Tcmalloc page size\n------------------------------------------------\nCall ReleaseFreeMemory() to release freelist memory to the OS (via madvise()).\nBytes released to the OS take up virtual address space but no physical memory.\n"
		}
	},
	"wiredTiger" : {
		"uri" : "statistics:",
		"LSM" : {
			"application work units currently queued" : 0,
			"merge work units currently queued" : 0,
			"rows merged in an LSM tree" : 0,
			"sleep for LSM checkpoint throttle" : 0,
			"sleep for LSM merge throttle" : 0,
			"switch work units currently queued" : 0,
			"tree maintenance operations discarded" : 0,
			"tree maintenance operations executed" : 0,
			"tree maintenance operations scheduled" : 0,
			"tree queue hit maximum" : 0
		},
		"async" : {
			"current work queue length" : 0,
			"maximum work queue length" : 0,
			"number of allocation state races" : 0,
			"number of flush calls" : 0,
			"number of operation slots viewed for allocation" : 0,
			"number of times operation allocation failed" : 0,
			"number of times worker found no work" : 0,
			"total allocations" : 0,
			"total compact calls" : 0,
			"total insert calls" : 0,
			"total remove calls" : 0,
			"total search calls" : 0,
			"total update calls" : 0
		},
		"block-manager" : {
			"blocks pre-loaded" : 9,
			"blocks read" : 46,
			"blocks written" : 88,
			"bytes read" : 200704,
			"bytes written" : 520192,
			"bytes written for checkpoint" : 520192,
			"mapped blocks read" : 0,
			"mapped bytes read" : 0
		},
		"cache" : {
			"application threads page read from disk to cache count" : 8,
			"application threads page read from disk to cache time (usecs)" : 534,
			"application threads page write from cache to disk count" : 0,
			"application threads page write from cache to disk time (usecs)" : 0,
			"bytes belonging to page images in the cache" : 26200,
			"bytes currently in the cache" : 67488,
			"bytes not belonging to page images in the cache" : 41287,
			"bytes read into cache" : 24260,
			"bytes written from cache" : 219790,
			"checkpoint blocked page eviction" : 0,
			"eviction calls to get a page" : 3631,
			"eviction calls to get a page found queue empty" : 3631,
			"eviction calls to get a page found queue empty after locking" : 0,
			"eviction currently operating in aggressive mode" : 0,
			"eviction empty score" : 0,
			"eviction server candidate queue empty when topping up" : 0,
			"eviction server candidate queue not empty when topping up" : 0,
			"eviction server evicting pages" : 0,
			"eviction server slept, because we did not make progress with eviction" : 0,
			"eviction server unable to reach eviction goal" : 0,
			"eviction state" : 16,
			"eviction walks abandoned" : 0,
			"eviction worker thread active" : 0,
			"eviction worker thread created" : 0,
			"eviction worker thread evicting pages" : 0,
			"eviction worker thread removed" : 0,
			"eviction worker thread stable number" : 0,
			"failed eviction of pages that exceeded the in-memory maximum" : 0,
			"files with active eviction walks" : 0,
			"files with new eviction walks started" : 0,
			"force re-tuning of eviction workers once in a while" : 0,
			"hazard pointer blocked page eviction" : 0,
			"hazard pointer check calls" : 0,
			"hazard pointer check entries walked" : 0,
			"hazard pointer maximum array length" : 0,
			"in-memory page passed criteria to be split" : 0,
			"in-memory page splits" : 0,
			"internal pages evicted" : 0,
			"internal pages split during eviction" : 0,
			"leaf pages split during eviction" : 0,
			"lookaside table insert calls" : 0,
			"lookaside table remove calls" : 0,
			"maximum bytes configured" : 270403633152,
			"maximum page size at eviction" : 0,
			"modified pages evicted" : 0,
			"modified pages evicted by application threads" : 0,
			"overflow pages read into cache" : 0,
			"overflow values cached in memory" : 0,
			"page split during eviction deepened the tree" : 0,
			"page written requiring lookaside records" : 0,
			"pages currently held in the cache" : 19,
			"pages evicted because they exceeded the in-memory maximum" : 0,
			"pages evicted because they had chains of deleted items" : 0,
			"pages evicted by application threads" : 0,
			"pages queued for eviction" : 0,
			"pages queued for urgent eviction" : 0,
			"pages queued for urgent eviction during walk" : 0,
			"pages read into cache" : 18,
			"pages read into cache requiring lookaside entries" : 0,
			"pages requested from the cache" : 345,
			"pages seen by eviction walk" : 0,
			"pages selected for eviction unable to be evicted" : 0,
			"pages walked for eviction" : 0,
			"pages written from cache" : 44,
			"pages written requiring in-memory restoration" : 0,
			"percentage overhead" : 8,
			"tracked bytes belonging to internal pages in the cache" : 14683,
			"tracked bytes belonging to leaf pages in the cache" : 52805,
			"tracked dirty bytes in the cache" : 0,
			"tracked dirty pages in the cache" : 0,
			"unmodified pages evicted" : 0
		},
		"connection" : {
			"auto adjusting condition resets" : 80,
			"auto adjusting condition wait calls" : 173703031,
			"files currently open" : 13,
			"memory allocations" : 405335256,
			"memory frees" : 405334320,
			"memory re-allocations" : 86864333,
			"pthread mutex condition wait calls" : 466333645,
			"pthread mutex shared lock read-lock calls" : 173701346,
			"pthread mutex shared lock write-lock calls" : 28948735,
			"total fsync I/Os" : 82,
			"total read I/Os" : 505,
			"total write I/Os" : 128
		},
		"cursor" : {
			"cursor create calls" : 42,
			"cursor insert calls" : 31,
			"cursor next calls" : 95,
			"cursor prev calls" : 7,
			"cursor remove calls" : 1,
			"cursor reset calls" : 322,
			"cursor restarted searches" : 0,
			"cursor search calls" : 303,
			"cursor search near calls" : 9,
			"cursor update calls" : 0,
			"truncate calls" : 0
		},
		"data-handle" : {
			"connection data handles currently active" : 10,
			"connection sweep candidate became referenced" : 0,
			"connection sweep dhandles closed" : 0,
			"connection sweep dhandles removed from hash list" : 9,
			"connection sweep time-of-death sets" : 9,
			"connection sweeps" : 2895435,
			"session dhandles swept" : 0,
			"session sweep attempts" : 21
		},
		"lock" : {
			"checkpoint lock acquisitions" : 13,
			"checkpoint lock application thread wait time (usecs)" : 0,
			"checkpoint lock internal thread wait time (usecs)" : 3,
			"handle-list lock eviction thread wait time (usecs)" : 7812945,
			"metadata lock acquisitions" : 13,
			"metadata lock application thread wait time (usecs)" : 0,
			"metadata lock internal thread wait time (usecs)" : 5,
			"schema lock acquisitions" : 24,
			"schema lock application thread wait time (usecs)" : 0,
			"schema lock internal thread wait time (usecs)" : 0,
			"table lock acquisitions" : 0,
			"table lock application thread time waiting for the table lock (usecs)" : 0,
			"table lock internal thread time waiting for the table lock (usecs)" : 0
		},
		"log" : {
			"busy returns attempting to switch slots" : 0,
			"consolidated slot closures" : 23,
			"consolidated slot join active slot closed" : 0,
			"consolidated slot join races" : 0,
			"consolidated slot join transitions" : 23,
			"consolidated slot joins" : 31,
			"consolidated slot transitions unable to find free slot" : 0,
			"consolidated slot unbuffered writes" : 0,
			"log bytes of payload data" : 8096,
			"log bytes written" : 10752,
			"log files manually zero-filled" : 0,
			"log flush operations" : 289208683,
			"log force write operations" : 318157332,
			"log force write operations skipped" : 318157370,
			"log records compressed" : 9,
			"log records not compressed" : 0,
			"log records too small to compress" : 22,
			"log release advances write LSN" : 15,
			"log scan operations" : 3,
			"log scan records requiring two reads" : 3,
			"log server thread advances write LSN" : 8,
			"log server thread write LSN walk skipped" : 28952054,
			"log sync operations" : 23,
			"log sync time duration (usecs)" : 169202,
			"log sync_dir operations" : 1,
			"log sync_dir time duration (usecs)" : 1457,
			"log write operations" : 31,
			"logging bytes consolidated" : 10368,
			"maximum log file size" : 104857600,
			"number of pre-allocated log files to create" : 2,
			"pre-allocated log files not ready and missed" : 1,
			"pre-allocated log files prepared" : 2,
			"pre-allocated log files used" : 0,
			"records processed by log scan" : 9,
			"total in-memory size of compressed records" : 11837,
			"total log buffer size" : 33554432,
			"total size of compressed records" : 7236,
			"written slots coalesced" : 0,
			"yields waiting for previous log file close" : 0
		},
		"reconciliation" : {
			"fast-path pages deleted" : 0,
			"page reconciliation calls" : 44,
			"page reconciliation calls for eviction" : 0,
			"pages deleted" : 0,
			"split bytes currently awaiting free" : 0,
			"split objects currently awaiting free" : 0
		},
		"session" : {
			"open cursor count" : 29,
			"open session count" : 16,
			"table alter failed calls" : 0,
			"table alter successful calls" : 0,
			"table alter unchanged and skipped" : 0,
			"table compact failed calls" : 0,
			"table compact successful calls" : 0,
			"table create failed calls" : 0,
			"table create successful calls" : 0,
			"table drop failed calls" : 0,
			"table drop successful calls" : 0,
			"table rebalance failed calls" : 0,
			"table rebalance successful calls" : 0,
			"table rename failed calls" : 0,
			"table rename successful calls" : 0,
			"table salvage failed calls" : 0,
			"table salvage successful calls" : 0,
			"table truncate failed calls" : 0,
			"table truncate successful calls" : 0,
			"table verify failed calls" : 0,
			"table verify successful calls" : 0
		},
		"thread-state" : {
			"active filesystem fsync calls" : 0,
			"active filesystem read calls" : 0,
			"active filesystem write calls" : 0
		},
		"thread-yield" : {
			"application thread time evicting (usecs)" : 0,
			"application thread time waiting for cache (usecs)" : 0,
			"page acquire busy blocked" : 0,
			"page acquire eviction blocked" : 0,
			"page acquire locked blocked" : 0,
			"page acquire read blocked" : 0,
			"page acquire time sleeping (usecs)" : 0
		},
		"transaction" : {
			"number of named snapshots created" : 0,
			"number of named snapshots dropped" : 0,
			"transaction begins" : 26,
			"transaction checkpoint currently running" : 0,
			"transaction checkpoint generation" : 13,
			"transaction checkpoint max time (msecs)" : 17,
			"transaction checkpoint min time (msecs)" : 2,
			"transaction checkpoint most recent time (msecs)" : 4,
			"transaction checkpoint scrub dirty target" : 0,
			"transaction checkpoint scrub time (msecs)" : 0,
			"transaction checkpoint total time (msecs)" : 74,
			"transaction checkpoints" : 13,
			"transaction checkpoints skipped because database was clean" : 482565,
			"transaction failures due to cache overflow" : 0,
			"transaction fsync calls for checkpoint after allocating the transaction ID" : 13,
			"transaction fsync duration for checkpoint after allocating the transaction ID (usecs)" : 0,
			"transaction range of IDs currently pinned" : 0,
			"transaction range of IDs currently pinned by a checkpoint" : 0,
			"transaction range of IDs currently pinned by named snapshots" : 0,
			"transaction sync calls" : 0,
			"transactions committed" : 8,
			"transactions rolled back" : 18
		},
		"concurrentTransactions" : {
			"write" : {
				"out" : 0,
				"available" : 128,
				"totalTickets" : 128
			},
			"read" : {
				"out" : 0,
				"available" : 128,
				"totalTickets" : 128
			}
		}
	},
	"mem" : {
		"bits" : 64,
		"resident" : 51,
		"virtual" : 437,
		"supported" : true,
		"mapped" : 0,
		"mappedWithJournal" : 0
	},
	"metrics" : {
		"commands" : {
			"_isSelf" : {
				"failed" : NumberLong(0),
				"total" : NumberLong(11)
			},
			"buildInfo" : {
				"failed" : NumberLong(0),
				"total" : NumberLong(2)
			},
			"isMaster" : {
				"failed" : NumberLong(0),
				"total" : NumberLong(30)
			},
			"replSetGetStatus" : {
				"failed" : NumberLong(0),
				"total" : NumberLong(11)
			},
			"replSetHeartbeat" : {
				"failed" : NumberLong(0),
				"total" : NumberLong(28866960)
			},
			"replSetRequestVotes" : {
				"failed" : NumberLong(0),
				"total" : NumberLong(22)
			},
			"saslContinue" : {
				"failed" : NumberLong(0),
				"total" : NumberLong(74)
			},
			"saslStart" : {
				"failed" : NumberLong(1),
				"total" : NumberLong(38)
			},
			"serverStatus" : {
				"failed" : NumberLong(0),
				"total" : NumberLong(1)
			},
			"whatsmyuri" : {
				"failed" : NumberLong(0),
				"total" : NumberLong(1)
			}
		},
		"cursor" : {
			"timedOut" : NumberLong(0),
			"open" : {
				"noTimeout" : NumberLong(0),
				"pinned" : NumberLong(0),
				"total" : NumberLong(0)
			}
		},
		"document" : {
			"deleted" : NumberLong(0),
			"inserted" : NumberLong(0),
			"returned" : NumberLong(0),
			"updated" : NumberLong(0)
		},
		"getLastError" : {
			"wtime" : {
				"num" : 0,
				"totalMillis" : 0
			},
			"wtimeouts" : NumberLong(0)
		},
		"operation" : {
			"scanAndOrder" : NumberLong(0),
			"writeConflicts" : NumberLong(0)
		},
		"queryExecutor" : {
			"scanned" : NumberLong(0),
			"scannedObjects" : NumberLong(0)
		},
		"record" : {
			"moves" : NumberLong(0)
		},
		"repl" : {
			"executor" : {
				"counters" : {
					"eventCreated" : 0,
					"eventWait" : 0,
					"cancels" : 0,
					"waits" : 0,
					"scheduledNetCmd" : 11635483,
					"scheduledDBWork" : 1,
					"scheduledXclWork" : 0,
					"scheduledWorkAt" : 12314625,
					"scheduledWork" : 0,
					"schedulingFailures" : 0
				},
				"queues" : {
					"networkInProgress" : 0,
					"dbWorkInProgress" : 0,
					"exclusiveInProgress" : 0,
					"sleepers" : 2,
					"ready" : 0,
					"free" : 1
				},
				"unsignaledEvents" : 2,
				"eventWaiters" : 0,
				"shuttingDown" : false,
				"networkInterface" : "\nNetworkInterfaceASIO Operations' Diagnostic:\nOperation:    Count:     \nConnecting    0          \nIn Progress   0          \nSucceeded     11551189   \nCanceled      0          \nFailed        84294      \nTimed Out     145        \n\n"
			},
			"apply" : {
				"attemptsToBecomeSecondary" : NumberLong(0),
				"batches" : {
					"num" : 0,
					"totalMillis" : 0
				},
				"ops" : NumberLong(0)
			},
			"buffer" : {
				"count" : NumberLong(0),
				"maxSizeBytes" : NumberLong(0),
				"sizeBytes" : NumberLong(0)
			},
			"initialSync" : {
				"completed" : NumberLong(0),
				"failedAttempts" : NumberLong(0),
				"failures" : NumberLong(0)
			},
			"network" : {
				"bytes" : NumberLong(0),
				"getmores" : {
					"num" : 0,
					"totalMillis" : 0
				},
				"ops" : NumberLong(0),
				"readersCreated" : NumberLong(0)
			},
			"preload" : {
				"docs" : {
					"num" : 0,
					"totalMillis" : 0
				},
				"indexes" : {
					"num" : 0,
					"totalMillis" : 0
				}
			}
		},
		"storage" : {
			"freelist" : {
				"search" : {
					"bucketExhausted" : NumberLong(0),
					"requests" : NumberLong(0),
					"scanned" : NumberLong(0)
				}
			}
		},
		"ttl" : {
			"deletedDocuments" : NumberLong(0),
			"passes" : NumberLong(0)
		}
	},
	"ok" : 1
}

其中有这个

"storageEngine" : {
		"name" : "wiredTiger",
		"supportsCommittedReads" : true,
		"readOnly" : false,
		"persistent" : true
	},

mongo内存占用过大http://www.ipcpu.com/2017/01/mongodb-oom/

查看WiredTiger内部缓存到底占用了多少内存的方式是,在mongo shell中之行以下命令

db.runCommand( { serverStatus: 1 } ).wiredTiger.cache["bytes currently in the cache"]

如果不想重启mongoDB,可以在线修改,如下

db.adminCommand({setParameter: 1, wiredTigerEngineRuntimeConfig: "cache_size=8G"})

猜你喜欢

转载自blog.csdn.net/qq_30831237/article/details/86001465
今日推荐