排查 macOS 上Microsoft Defender for Endpoint的性能问题

适用于:

希望体验 Microsoft Defender for Endpoint? 注册免费试用版

本文提供了一些常规步骤,可用于缩小与 macOS 上的 Defender for Endpoint 相关的性能问题的范围。

根据正在运行的应用程序和设备特征,在 macOS 上运行 Microsoft Defender for Endpoint 时,可能会遇到性能不佳的问题。 具体而言,在短时间跨度内访问许多资源的应用程序或系统进程可能会导致 macOS 上的 Defender for Endpoint 的性能问题。

警告

在执行本文中所述的过程之前,请确保其他安全产品当前未在设备上运行。 多个安全产品可能会发生冲突并影响主机性能。

使用实时保护统计信息排查性能问题

适用于:

  • 仅与Microsoft Defender防病毒相关的性能问题 (wdavdaemon_unpriviliged) 。

实时保护 (RTP) 是 macOS 上的 Defender for Endpoint 的一项功能,可持续监视和保护设备免受威胁。 它由文件和进程监视以及其他启发式方法组成。

先决条件:

  • Microsoft Defender for Endpoint版本 (平台更新) 100.90.70 或更高版本
  • 如果在阻止模式下打开了 篡改防护 ,请使用 故障排除模式 捕获实时保护统计信息。 否则,将获得 null 结果。

若要排查和缓解此类问题,请执行以下步骤:

  1. 使用下表中的方法之一禁用实时保护,然后观察性能是否提高。 此方法有助于缩小 macOS 上的Microsoft Defender for Endpoint是否导致了性能问题。

    设备管理 方法
    设备不由组织管理 用户界面:在 macOS 上打开Microsoft Defender for Endpoint并导航到“管理设置”。
    设备不由组织管理 终端:在终端中运行以下命令: mdatp config real-time-protection --value disabled
    设备由组织管理 请参阅在 macOS 上设置Microsoft Defender for Endpoint首选项

    如果在关闭实时保护时性能问题仍然存在,则问题的根源可能是终结点检测和响应组件。 在这种情况下,请联系客户支持以获取进一步的说明和缓解措施。

  2. 打开 Finder 并导航到 “应用程序>实用工具”。 打开 活动监视器 并分析哪些应用程序正在使用系统上的资源。 典型示例包括软件更新器和编译器。

  3. 此功能需要启用实时保护。 若要检查实时保护的状态,请运行以下命令:

    mdatp health --field real_time_protection_enabled
    

    验证 real_time_protection_enabled 项是否 为 true。 否则,请运行以下命令以启用它:

    mdatp config real-time-protection --value enabled
    
    Configuration property updated
    
  4. 若要查找触发最多扫描的应用程序,可以使用 macOS 上的 Defender for Endpoint 收集的实时统计信息。 运行以下命令:

    mdatp config real-time-protection-statistics --value enabled.
    

    此功能需要启用实时保护。 若要检查实时保护的状态,请运行以下命令:

    mdatp diagnostic real-time-protection-statistics --output json > real_time_protection.json
    

    注意

    使用 --output json (记下双短划线) 可确保输出格式已准备好进行分析。 此命令的输出将显示所有进程及其关联的扫描活动。

  5. 在 Mac 系统上,使用 命令下载示例 Python 分析程序 high_cpu_parser.py

    curl -O https://raw.githubusercontent.com/microsoft/mdatp-xplat/master/linux/diagnostic/high_cpu_parser.py
    

    此命令的输出应类似于以下内容:

    --2020-11-14 11:27:27-- https://raw.githubusercontent.com/microsoft.
    mdatp-xplat/master/linus/diagnostic/high_cpu_parser.py
    Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.xxx.xxx
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)| 151.101.xxx.xxx| :443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1020 [text/plain]
    Saving to: 'high_cpu_parser.py'
    100%[===========================================>] 1,020    --.-K/s   in
    0s
    
  6. 键入以下命令:

    chmod +x high_cpu_parser.py
    
    cat real_time_protection.json | python high_cpu_parser.py  > real_time_protection.log
    

    输出应是性能问题的主要参与者列表。 第一列是 PID) (进程标识符,第二列是进程名称,最后一列是扫描的文件数(按影响排序)。 下面是一个示例:

    ... > python ~/repo/mdatp-xplat/linux/diagnostic/high_cpu_parser.py <~Downloads/output.json | head -n 10
    27432 None 76703
    73467 actool     1249
    73914 xcodebuild 1081
    73873 bash 1050
    27475 None 836
    1    launchd    407
    73468 ibtool     344
    549  telemetryd_v1   325
    4764 None 228
    125  CrashPlanService 164
    
  7. 若要提高 Mac 上的 Defender for Endpoint 的性能,请在 “扫描的文件总数 ”行下找到编号最高的一个,然后为其添加排除项。 有关详细信息,请参阅 在 macOS 上配置和验证 Defender for Endpoint 的排除项。

    注意

    应用程序将统计信息存储在内存中,并且仅跟踪文件活动,因为它已启动并启用实时保护。 在实时保护关闭之前或期间启动的进程不计算在内。 此外,仅对触发扫描的事件进行计数。

  8. 在 macOS 上配置Microsoft Defender for Endpoint,其中包含导致性能问题的进程或磁盘位置的排除项,并重新启用实时保护。

    请参阅配置和验证 macOS 上Microsoft Defender for Endpoint的排除项。

使用 Microsoft Defender for Endpoint 客户端分析器排查性能问题

Microsoft Defender for Endpoint客户端分析器 (MDECA) 可以收集跟踪、日志和诊断信息,以便排查 macOS 上载入设备上的性能问题。

若要运行客户端分析器来排查性能问题,请参阅 在 macOS 和 Linux 上运行客户端分析器

注意

  • Microsoft 客户支持服务 (CSS) 定期使用 Microsoft Defender for Endpoint 客户端分析器工具来收集 ((但不限于) IP 地址、电脑名称)等信息,可帮助排查Microsoft Defender for Endpoint可能会遇到的问题。 有关我们的隐私声明的详细信息,请参阅 Microsoft 隐私声明
  • 作为一般最佳做法,建议将 Microsoft Defender for Endpoint 代理更新到最新可用版本,并在进一步调查之前确认问题仍然存在。