Database Manual / Self-Managed Deployments / Administration / Performance

Full Time Diagnostic Data Capture全职诊断数据采集

To help MongoDB engineers analyze server behavior, mongod and mongos processes include a Full Time Diagnostic Data Capture (FTDC) mechanism. 为了帮助MongoDB工程师分析服务器行为,mongodmongos进程包括一个全职诊断数据捕获(FTDC)机制。FTDC is enabled by default. 默认情况下启用FTDC。Due to its importance in debugging deployments, FTDC thread failures are fatal and stop the parent mongod or mongos process.由于其在调试部署中的重要性,FTDC线程故障是致命的,会停止父进程mongodmongos

Behavior行为

Note

FTDC User Permissions on WindowsWindows上的FTDC用户权限

On Windows, to collect system data such as disk, cpu, and memory, FTDC requires Microsoft access permissions from the following groups:在Windows上,要集合磁盘、cpu和内存等系统数据,FTDC需要以下组的Microsoft访问权限:

  • Performance Monitor Users性能监视器用户
  • Performance Log Users性能日志用户

If the user running mongod and mongos is not an administrator, add them to these groups to log FTDC data. 如果运行mongodmongos的用户不是管理员,请将它们添加到这些组中以记录FTDC数据。For more information, see the Microsoft documentation here.有关详细信息,请参阅此处的Microsoft文档

FTDC periodically collects statistics produced by the following commands:FTDC定期集合由以下命令生成的统计数据:

Depending on the host operating system, the diagnostic data may include one or more of the following utilization statistics:根据主机操作系统的不同,诊断数据可能包括以下一个或多个利用率统计数据:

  • CPU utilization占用率
  • Memory utilization内存利用率
  • Disk utilization related to performance. FTDC does not include data related to storage capacity.与性能相关的磁盘利用率。FTDC不包括与存储容量相关的数据。
  • Network performance statistics. FTDC only captures metadata and does not capture or inspect any network packets.网络性能统计。FTDC仅捕获元数据,不捕获或检查任何网络数据包。

Note

If the mongod process runs in a container, FTDC reports utilization statistics from the perspective of the container instead of the host operating system. 如果mongod进程在容器中运行,FTDC会从容器而不是主机操作系统的角度报告利用率统计数据。For example, if a the mongod runs in a container that is configured with RAM restrictions, FTDC calculates memory utilization against the container's RAM limit, as opposed to the host operating system's RAM limit.例如,如果mongod在配置了RAM限制的容器中运行,FTDC会根据容器的RAM限制计算内存利用率,而不是主机操作系统的RAM限制。

FTDC collects statistics produced by the following commands on file rotation or startup:FTDC在文件旋转或启动时集合由以下命令生成的统计数据:

FTDC Data FilesFTDC数据文件

mongod processes store FTDC data files in a diagnostic.data directory under the instances storage.dbPath. All diagnostic data files are stored under this directory. mongod进程将FTDC数据文件存储在实例storagedbPath下的诊断数据目录中。所有诊断数据文件都存储在此目录下。For example, given a dbPath of /data/db, the diagnostic data directory would be /data/db/diagnostic.data.例如,给定dbPath为/data/db,诊断数据目录将为/data/db/diagnosticdata。

mongos processes store FTDC data files in a diagnostic directory relative to the systemLog.path log path setting. 进程将FTDC数据文件存储在相对于systemLog.path日志路径设置的诊断目录中。MongoDB truncates the logpath's file extension and concatenates diagnostic.data to the remaining name. MongoDB截断日志路径的文件扩展名,并将diagnostic.data连接到剩余名称。For example, given a path setting of /var/log/mongodb/mongos.log, the diagnostic data directory would be /var/log/mongodb/mongos.diagnostic.data.例如,给定path设置为/var/log/mongodb/mongos.log,诊断数据目录将为/var/log/mongodb/mongos.diagnostic.data

FTDC PrivacyFTDC隐私

FTDC data files are compressed and not human-readable. They inherit the same file access permissions as the MongoDB data files. Only users with access to FTDC data files can transmit the FTDC data.FTDC数据文件是压缩的,人类无法读取。它们继承了与MongoDB数据文件相同的文件访问权限。只有有权访问FTDC数据文件的用户才能传输FTDC数据。

MongoDB engineers cannot access FTDC data without explicit permission and assistance from system owners or operators未经系统所有者或运算符的明确许可和协助,MongoDB工程师无法访问FTDC数据.

FTDC data never contains any of the following information:FTDC数据从不包含以下任何信息:

  • Samples of queries, query predicates, or query results查询、查询谓词或查询结果示例
  • Data sampled from any end-user collection or index从任何最终用户集合或索引中采样的数据
  • System or MongoDB user credentials or security certificates系统或MongoDB用户凭据或安全证书

FTDC data contains certain host machine information such as hostnames, operating system information, and the options or settings used to start the mongod or mongos. FTDC数据包含某些主机信息,如主机名、操作系统信息以及用于启动mongodmongos的选项或设置。This information may be considered protected or confidential by some organizations or regulatory bodies, but is not typically considered to be Personally Identifiable Information (PII). 这些信息可能被一些组织或监管机构视为受保护或机密,但通常不被视为个人身份信息(PII)。For clusters where these fields are configured with protected, confidential, or PII data, please notify MongoDB engineers before sending FTDC data to coordinate appropriate security measures.对于这些字段配置了受保护、机密或PII数据的集群,请在发送FTDC数据之前通知MongoDB工程师,以协调适当的安全措施。

Details详情

You can view the FTDC source code on the MongoDB Github Repository. The ftdc_system_stats_*.ccp files specifically define any system-specific diagnostic data captured.您可以在MongoDB Github Repository上查看FTDC源代码。ftdc_system_stats_*ccp文件专门定义了捕获的任何特定于系统的诊断数据。

FTDC DefaultsFTDC默认值

FTDC runs with the following defaults:FTDC以以下默认值运行:

  • Data capture every 1 second
  • 200MB maximum diagnostic.data folder size.最大diagnostic.data文件夹大小为200MB。

These defaults are designed to provide useful data to MongoDB engineers with minimal impact on performance or storage size. These values only require modifications if requested by MongoDB engineers for specific diagnostic purposes.这些默认值旨在为MongoDB工程师提供有用的数据,同时对性能或存储大小的影响最小。只有当MongoDB工程师出于特定诊断目的要求时,这些值才需要修改。

Disable FTD禁用FTDC

To disable FTDC, start up the mongod or mongos with the diagnosticDataCollectionEnabled: false option in the setParameter settings of your configuration file:要禁用FTDC,请在配置文件的setParameter设置中使用diagnosticDataCollectionEnabled:false选项启动mongodmongos

setParameter:
diagnosticDataCollectionEnabled: false

Disabling FTDC may increase the time or resources required when analyzing or debugging issues with support from MongoDB engineers. 禁用FTDC可能会增加在MongoDB工程师的支持下分析或调试问题所需的时间或资源。For information on MongoDB Support, visit Get Started With MongoDB Support.有关MongoDB支持的信息,请访问开始使用MongoDB支持