hostInfo
Returns:A document with information about the underlying systemthat the mongod
or mongos
runs on.Some of the returned fields are only included on someplatforms.
You must run the hostInfo
command, which takes noarguments, against the admin
database. Consider the followinginvocations of hostInfo
:
- db.hostInfo()
- db.adminCommand( { "hostInfo" : 1 } )
In the mongo
shell you can use db.hostInfo()
as a helper to access hostInfo
. The output ofhostInfo
on a Linux system will resemble thefollowing:
- {
- "system" : {
- "currentTime" : ISODate("<timestamp>"),
- "hostname" : "<hostname>",
- "cpuAddrSize" : <number>,
- "memSizeMB" : <number>,
- "memLimitMB" : <number>, // Available starting in MongoDB 4.0.9 (and 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 underlyingenvironment of the system running the
mongod
ormongos
hostInfo.system.
hostname
- The system name, which should correspond to the output of
hostname -f
on Linux systems.
For example, running in a container may impose memory limits thatare lower than the total system memory. This memory limit, ratherthan the total system memory, is used as the maximum RAM availableto calculate WiredTiger internal cache.
Available starting in MongoDB 4.0.9 (and 3.6.13)
hostInfo.system.
numaEnabled
- A boolean value.
false
if NUMA is interleaved (i.e. disabled),otherwisetrue
.
hostInfo.
os
- An embedded document that contains information about the operatingsystem running the
mongod
andmongos
.
hostInfo.
extra
- An embedded document with extra information about the operating systemand the underlying hardware. The content of the
extra
embedded document depends on the operatingsystem.
cpuString
only appears on macOS systems.
hostInfo.extra.
versionString
- A complete string of the operating system version andidentification. On Linux and macOS systems, this contains outputsimilar to
uname -a
.
libcVersion
only appears on Linuxsystems.
kernelVersion
only appears on Linuxsystems.
hostInfo.extra.
alwaysFullSync
alwaysFullSync
only appears on macOSsystems.
hostInfo.extra.
nfsAsync
nfsAsync
only appears on macOSsystems.
hostInfo.extra.
cpuFeatures
- Reports the processor feature flags. On Linux systems this thesame information that
/proc/cpuinfo
includes in theflags
fields.
hostInfo.extra.
physicalCores
- Reports the number of physical, non-HyperThreading, cores available on thesystem.
physicalCores
only appears on macOS systems.
hostInfo.extra.
numPages
numPages
only appears on Linux systems.
hostInfo.extra.
maxOpenFiles
- Reports the current system limits on open file handles. SeeUNIX ulimit Settings for more information.
maxOpenFiles
only appears on Linuxsystems.
hostInfo.extra.
scheduler
- Reports the active I/O scheduler.
scheduler
only appears on OSX systems.