Skip to content

Commit 39b0552

Browse files
authored
Update linux-support-perf.md
1 parent aa42653 commit 39b0552

File tree

1 file changed

+79
-107
lines changed

1 file changed

+79
-107
lines changed

defender-endpoint/linux-support-perf.md

Lines changed: 79 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: deniseb
66
author: deniseb
77
ms.reviewer: gopkr
88
ms.localizationpriority: medium
9-
ms.date: 10/11/2024
9+
ms.date: 10/28/2024
1010
manager: deniseb
1111
audience: ITPro
1212
ms.collection:
@@ -39,112 +39,109 @@ Depending on the applications that you are running and your device characteristi
3939
## Troubleshoot performance issues using Real-time Protection Statistics
4040

4141
**Applies to:**
42-
- Only performance issues related to AV
42+
- Only performance issues related to antivirus
4343

4444
Real-time protection (RTP) is a feature of Defender for Endpoint on Linux that continuously monitors and protects your device against threats. It consists of file and process monitoring and other heuristics.
4545

4646
The following steps can be used to troubleshoot and mitigate these issues:
4747

48-
1. Disable real-time protection using one of the following methods and observe whether the performance improves. This approach helps narrow down whether Defender for Endpoint on Linux is contributing to the performance issues.
48+
1. Disable real-time protection using one of the following methods and observe whether the performance improves. This approach helps narrow down whether Defender for Endpoint on Linux is contributing to the performance issues. If your device is not managed by your organization, real-time protection can be disabled from the command line:
4949

50-
If your device is not managed by your organization, real-time protection can be disabled from the command line:
50+
```bash
51+
mdatp config real-time-protection --value disabled
52+
```
5153

52-
```bash
53-
mdatp config real-time-protection --value disabled
54-
```
54+
```Output
55+
Configuration property updated
56+
```
5557

56-
```Output
57-
Configuration property updated
58-
```
58+
If your device is managed by your organization, real-time protection can be disabled by your administrator using the instructions in [Set preferences for Defender for Endpoint on Linux](linux-preferences.md).
5959

60-
If your device is managed by your organization, real-time protection can be disabled by your administrator using the instructions in [Set preferences for Defender for Endpoint on Linux](linux-preferences.md).
61-
62-
> [!NOTE]
63-
> If the performance problem persists while real-time protection is off, the origin of the problem could be the endpoint detection and response (EDR) component. In this case please follow the steps from the **Troubleshoot performance issues using Microsoft Defender for Endpoint Client Analyzer** section of this article.
60+
> [!NOTE]
61+
> If the performance problem persists while real-time protection is off, the origin of the problem could be the endpoint detection and response (EDR) component. In this case please follow the steps from the **Troubleshoot performance issues using Microsoft Defender for Endpoint Client Analyzer** section of this article.
6462
6563
2. To find the applications that are triggering the most scans, you can use real-time statistics gathered by Defender for Endpoint on Linux.
6664

67-
> [!NOTE]
68-
> This feature is available in version 100.90.70 or newer.
65+
> [!NOTE]
66+
> This feature is available in version 100.90.70 or newer.
6967
70-
This feature is enabled by default on the `Dogfood` and `InsiderFast` channels. If you're using a different update channel, this feature can be enabled from the command line:
68+
This feature is enabled by default on the `Dogfood` and `InsiderFast` channels. If you're using a different update channel, this feature can be enabled from the command line:
7169

72-
```bash
73-
mdatp config real-time-protection-statistics --value enabled
74-
```
70+
```bash
71+
mdatp config real-time-protection-statistics --value enabled
72+
```
7573

76-
This feature requires real-time protection to be enabled. To check the status of real-time protection, run the following command:
74+
This feature requires real-time protection to be enabled. To check the status of real-time protection, run the following command:
7775

78-
```bash
79-
mdatp health --field real_time_protection_enabled
80-
```
76+
```bash
77+
mdatp health --field real_time_protection_enabled
78+
```
8179

82-
Verify that the `real_time_protection_enabled` entry is `true`. Otherwise, run the following command to enable it:
80+
Verify that the `real_time_protection_enabled` entry is `true`. Otherwise, run the following command to enable it:
8381

84-
```bash
85-
mdatp config real-time-protection --value enabled
86-
```
82+
```bash
83+
mdatp config real-time-protection --value enabled
84+
```
8785

88-
```Output
89-
Configuration property updated
90-
```
86+
```Output
87+
Configuration property updated
88+
```
9189

92-
To collect current statistics, run:
90+
To collect current statistics, run:
9391

94-
```bash
95-
mdatp diagnostic real-time-protection-statistics --output json
96-
```
92+
```bash
93+
mdatp diagnostic real-time-protection-statistics --output json
94+
```
9795

98-
> [!NOTE]
99-
> Using `--output json` (note the double dash) ensures that the output format is ready for parsing.
96+
> [!NOTE]
97+
> Using `--output json` (note the double dash) ensures that the output format is ready for parsing.
10098
101-
The output of this command will show all processes and their associated scan activity.
99+
The output of this command shows all processes and their associated scan activity.
102100

103101
3. On your Linux system, download the sample Python parser **high_cpu_parser.py** using the command:
104102

105-
```bash
106-
wget -c https://raw.githubusercontent.com/microsoft/mdatp-xplat/master/linux/diagnostic/high_cpu_parser.py
107-
```
103+
```bash
104+
wget -c https://raw.githubusercontent.com/microsoft/mdatp-xplat/master/linux/diagnostic/high_cpu_parser.py
105+
```
108106

109-
The output of this command should be similar to the following:
107+
The output of this command should be similar to the following:
110108

111-
```Output
112-
--2020-11-14 11:27:27-- https://raw.githubusercontent.com/microsoft.mdatp-xplat/master/linus/diagnostic/high_cpu_parser.py
113-
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.xxx.xxx
114-
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)| 151.101.xxx.xxx| :443... connected.
115-
HTTP request sent, awaiting response... 200 OK
116-
Length: 1020 [text/plain]
117-
Saving to: 'high_cpu_parser.py'
118-
100%[===========================================>] 1,020 --.-K/s in 0s
119-
```
109+
```Output
110+
--2020-11-14 11:27:27-- https://raw.githubusercontent.com/microsoft.mdatp-xplat/master/linus/diagnostic/high_cpu_parser.py
111+
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.xxx.xxx
112+
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)| 151.101.xxx.xxx| :443... connected.
113+
HTTP request sent, awaiting response... 200 OK
114+
Length: 1020 [text/plain]
115+
Saving to: 'high_cpu_parser.py'
116+
100%[===========================================>] 1,020 --.-K/s in 0s
117+
```
120118

121-
4. Next, type the following commands:
119+
4. Type the following commands:
122120

123-
```bash
124-
mdatp diagnostic real-time-protection-statistics --output json | python high_cpu_parser.py
125-
```
121+
```bash
122+
mdatp diagnostic real-time-protection-statistics --output json | python high_cpu_parser.py
123+
```
126124

127-
The output of the above is a list of the top contributors to performance issues. The first column is the process identifier (PID), the second column is the process name, and the last column is the number of scanned files, sorted by impact.
128-
For example, the output of the command will be something like the below:
125+
The output of the above is a list of the top contributors to performance issues. The first column is the process identifier (PID), the second column is the process name, and the last column is the number of scanned files, sorted by impact. For example, the output of the command will be something like the below:
129126

130-
```Output
131-
... > mdatp diagnostic real-time-protection-statistics --output json | python high_cpu_parser.py | head
132-
27432 None 76703
133-
73467 actool 1249
134-
73914 xcodebuild 1081
135-
73873 bash 1050
136-
27475 None 836
137-
1 launchd 407
138-
73468 ibtool 344
139-
549 telemetryd_v1 325
140-
4764 None 228
141-
125 CrashPlanService 164
142-
```
127+
```Output
128+
... > mdatp diagnostic real-time-protection-statistics --output json | python high_cpu_parser.py | head
129+
27432 None 76703
130+
73467 actool 1249
131+
73914 xcodebuild 1081
132+
73873 bash 1050
133+
27475 None 836
134+
1 launchd 407
135+
73468 ibtool 344
136+
549 telemetryd_v1 325
137+
4764 None 228
138+
125 CrashPlanService 164
139+
```
143140

144-
To improve the performance of Defender for Endpoint on Linux, locate the one with the highest number under the `Total files scanned` row and add an exclusion for it. For more information, see [Configure and validate exclusions for Defender for Endpoint on Linux](linux-exclusions.md).
141+
To improve the performance of Defender for Endpoint on Linux, locate the one with the highest number under the `Total files scanned` row and add an exclusion for it. For more information, see [Configure and validate exclusions for Defender for Endpoint on Linux](linux-exclusions.md).
145142

146-
> [!NOTE]
147-
> The application stores statistics in memory and only keeps track of file activity since it was started and real-time protection was enabled. Processes that were launched before or during periods when real time protection was off are not counted. Additionally, only events which triggered scans are counted.
143+
> [!NOTE]
144+
> The application stores statistics in memory and only keeps track of file activity since it was started and real-time protection was enabled. Processes that were launched before or during periods when real time protection was off are not counted. Additionally, only events which triggered scans are counted.
148145
149146

150147
## Troubleshoot performance issues using Microsoft Defender for Endpoint Client Analyzer
@@ -155,7 +152,6 @@ The following steps can be used to troubleshoot and mitigate these issues:
155152
The Microsoft Defender for Endpoint Client Analyzer (MDECA) can collect traces, logs, and diagnostic information in order to troubleshoot performance issues on [onboarded devices](onboard-configure.md) on Linux.
156153

157154
> [!NOTE]
158-
>
159155
> - The Microsoft Defender for Endpoint Client Analyzer tool is regularly used by Microsoft Customer Support Services (CSS) to collect information such as (but not limited to) IP addresses, PC names that will help troubleshoot issues you may be experiencing with Microsoft Defender for Endpoint. For more information about our privacy statement, see [Microsoft Privacy Statement](https://privacy.microsoft.com/privacystatement).
160156
> - As a general best practice, it is recommended to update the [Microsoft Defender for Endpoint agent to latest available version](mac-whatsnew.md) and confirming that the issue still persists before investigating further.
161157
@@ -164,10 +160,7 @@ To run the client analyzer for troubleshooting performance issues, see [Run the
164160

165161
## Configure Global Exclusions for better performance
166162

167-
Configure Microsoft Defender for Endpoint on Linux with exclusions for the processes or disk locations that contribute to the performance issues.
168-
169-
For more information, see [Configure and validate exclusions for Microsoft Defender for Endpoint on Linux](linux-exclusions.md).
170-
163+
Configure Microsoft Defender for Endpoint on Linux with exclusions for the processes or disk locations that contribute to the performance issues. For more information, see [Configure and validate exclusions for Microsoft Defender for Endpoint on Linux](linux-exclusions.md).
171164

172165
> [!NOTE]
173166
> In case after following the above steps, the performance problem persists, please contact customer support for further instructions and mitigation.
@@ -190,50 +183,29 @@ In certain server workloads, two issues might be observed:
190183

191184
- ***/var/log/audit/audit.log*** becoming large or frequently rotating.
192185

193-
These issues may occur on servers with many events flooding AuditD.
186+
These issues may occur on servers with many events flooding AuditD. Such issues can arise if there are multiple consumers for AuditD, or too many rules with the combination of Microsoft Defender for Endpoint and third party consumers, or high workload that generates a lot of events. To troubleshoot such issues, begin by [collecting MDEClientAnalyzer logs](run-analyzer-macos-linux.md) on the sample affected server.
194187

195-
> [!NOTE]
196-
> As a best practice, we recommend to configure AuditD logs to rotate when the maximum file size limit is reached.
197-
>
198-
> This will prevent AuditD logs accumulating in a single file and the rotated log files can be moved out to save disk space.
199-
>
200-
> To achieve this, you can set the value for **max_log_file_action** to **rotate** in the [auditd.conf](https://linux.die.net/man/8/auditd.conf) file.
188+
As a best practice, we recommend to configure AuditD logs to rotate when the maximum file size limit is reached. This configuration prevents AuditD logs from accumulating in a single file, and the rotated log files can be moved out to save disk space. To achieve this, you can set the value for `max_log_file_action` to `rotate` in the [auditd.conf](https://linux.die.net/man/8/auditd.conf) file.
201189

202-
This can happen if there are multiple consumers for AuditD, or too many rules with the combination of Microsoft Defender for Endpoint and third party consumers, or high workload that generates a lot of events.
203-
204-
To troubleshoot such issues, begin by [collecting MDEClientAnalyzer logs](run-analyzer-macos-linux.md) on the sample affected server.
205-
206190
> [!NOTE]
207-
> As a general best practice, it is recommended to update the [Microsoft Defender for Endpoint agent to latest available version](linux-whatsnew.md) and confirming issue still persists before investigating further.
208-
>
209-
> That there are additional configurations that can affect AuditD subsystem CPU strain.
210-
>
211-
> Specifically, in [auditd.conf](https://linux.die.net/man/8/auditd.conf), the value for **disp_qos** can be set to "lossy" to reduce the high CPU consumption.
212-
>
213-
> However, this means that some events may be dropped during peak CPU consumption.
191+
> As a general best practice, it is recommended to update the [Microsoft Defender for Endpoint agent to latest available version](linux-whatsnew.md) and confirming issue still persists before investigating further. That there are additional configurations that can affect AuditD subsystem CPU strain. Specifically, in [auditd.conf](https://linux.die.net/man/8/auditd.conf), the value for `disp_qos` can be set to `lossy` to reduce the high CPU consumption. However, this means that some events may be dropped during peak CPU consumption.
214192
215193
### XMDEClientAnalyzer
216194

217195
When you use [XMDEClientAnalyzer](run-analyzer-macos-linux.md), the following files will display output that provides insights to help you troubleshoot issues.
218196

219-
- auditd_info.txt
220-
- auditd_log_analysis.txt
197+
- `auditd_info.txt`
198+
- `auditd_log_analysis.txt`
221199

222200
#### auditd_info.txt
223201

224-
Contains general AuditD configuration and will display:
202+
Contains general AuditD configuration and displays the following information:
225203

226204
- What processes are registered as AuditD consumers.
227205

228-
- **Auditctl -s** output with **enabled=2**
229-
230-
- Suggests auditd is in immutable mode (requires restart for any config changes to take effect).
231-
232-
- **Auditctl -l** output
233-
234-
- Will show what rules are currently loaded into the kernel (which may be different that what exists on disk in "/etc/auditd/rules.d/mdatp.rules").
206+
- `Auditctl -s` output with `enabled=2` (Suggests auditd is in immutable mode (requires restart for any config changes to take effect.)
235207

236-
- Will show which rules are related to Microsoft Defender for Endpoint.
208+
- `Auditctl -l` output (Shows what rules are currently loaded into the kernel, which might differ from what exists on disk in `/etc/auditd/rules.d/mdatp.rules`. Also shows which rules are related to Microsoft Defender for Endpoint.)
237209

238210
#### auditd_log_analysis.txt
239211

0 commit comments

Comments
 (0)