On this page
hostInfo
On this page
hostInfo-
Returns: A document with information about the underlying system that the mongodormongosruns on. Some of the returned fields are only included on some platforms.You must run the
hostInfocommand, which takes no arguments, against theadmindatabase. Consider the following invocations ofhostInfo:db.hostInfo() db.adminCommand( { "hostInfo" : 1 } )In the
mongoshell you can usedb.hostInfo()as a helper to accesshostInfo. The output ofhostInfoon a Linux system will resemble the following:{ "system" : { "currentTime" : ISODate("<timestamp>"), "hostname" : "<hostname>", "cpuAddrSize" : <number>, "memSizeMB" : <number>, "memLimitMB" : <number>, // Available starting in MongoDB 3.6.13 "numCores" : <number>, "cpuArch" : "<identifier>", "numaEnabled" : <boolean> }, "os" : { "type" : "<string>", "name" : "<string>", "version" : "<string>" }, "extra" : { "versionString" : "<string>", "libcVersion" : "<string>", "kernelVersion" : "<string>", "cpuFrequencyMHz" : "<string>", "cpuFeatures" : "<string>", "pageSize" : <number>, "numPages" : <number>, "maxOpenFiles" : <number> }, "ok" : <return> }
Output
hostInfo-
The document returned by the
hostInfo.
hostInfo.system-
An embedded document providing information about the underlying environment of the system running the
mongodormongos
hostInfo.system.hostname-
The system name, which should correspond to the output of
hostname -fon Linux systems.
hostInfo.system.memLimitMB-
New in version 3.6.13.
The memory usage limit in megabytes.
For example, running in a container may impose memory limits that are lower than the total system memory. This memory limit, rather than the total system memory, is used as the maximum RAM available to calculate WiredTiger internal cache.
hostInfo.system.numaEnabled-
A boolean value.
falseif NUMA is interleaved (i.e. disabled), otherwisetrue.
hostInfo.os-
An embedded document that contains information about the operating system running the
mongodandmongos.
hostInfo.extra-
An embedded document with extra information about the operating system and the underlying hardware. The content of the
extraembedded document depends on the operating system.
hostInfo.extra.cpuString-
A string containing a human-readable description of the system’s processor.
cpuStringonly appears on macOS systems.
hostInfo.extra.versionString-
A complete string of the operating system version and identification. On Linux and macOS systems, this contains output similar to
uname -a.
hostInfo.extra.libcVersion-
The release of the system
libc.libcVersiononly appears on Linux systems.
hostInfo.extra.kernelVersion-
The release of the Linux kernel in current use.
kernelVersiononly appears on Linux systems.
hostInfo.extra.alwaysFullSync-
alwaysFullSynconly appears on macOS systems.
hostInfo.extra.nfsAsync-
nfsAsynconly appears on macOS systems.
hostInfo.extra.cpuFeatures-
Reports the processor feature flags. On Linux systems this the same information that
/proc/cpuinfoincludes in theflagsfields.
hostInfo.extra.physicalCores-
Reports the number of physical, non-HyperThreading, cores available on the system.
physicalCoresonly appears on macOS systems.
hostInfo.extra.numPages-
numPagesonly appears on Linux systems.
hostInfo.extra.maxOpenFiles-
Reports the current system limits on open file handles. See UNIX ulimit Settings for more information.
maxOpenFilesonly appears on Linux systems.
hostInfo.extra.scheduler-
Reports the active I/O scheduler.
scheduleronly appears on OS X systems.