Skip to content

Commit e0b09d8

Browse files
authored
Merge pull request #1716 from AruneemaXD/AruneemaXD-perf-edit
[MDE Linux] Point to (Global) Exclusions in Performance issues troubleshooting
2 parents 1e5c52e + c167c28 commit e0b09d8

File tree

1 file changed

+88
-114
lines changed

1 file changed

+88
-114
lines changed

defender-endpoint/linux-support-perf.md

Lines changed: 88 additions & 114 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,116 +39,110 @@ 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-
```
108-
109-
The output of this command should be similar to the following:
103+
```bash
104+
wget -c https://raw.githubusercontent.com/microsoft/mdatp-xplat/master/linux/diagnostic/high_cpu_parser.py
105+
```
110106

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-
```
107+
The output of this command should be similar to the following:
120108

121-
4. Next, type the following commands:
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+
```
122118

123-
```bash
124-
mdatp diagnostic real-time-protection-statistics --output json | python high_cpu_parser.py
125-
```
119+
4. Type the following commands:
126120

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:
121+
```bash
122+
mdatp diagnostic real-time-protection-statistics --output json | python high_cpu_parser.py
123+
```
129124

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-
```
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:
143126

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).
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+
```
145140

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.
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).
148142

149-
5. Configure Microsoft Defender for Endpoint on Linux with exclusions for the processes or disk locations that contribute to the performance issues and re-enable real-time protection.
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.
150145
151-
For more information, see [Configure and validate exclusions for Microsoft Defender for Endpoint on Linux](linux-exclusions.md).
152146

153147
## Troubleshoot performance issues using Microsoft Defender for Endpoint Client Analyzer
154148

@@ -158,14 +152,14 @@ The following steps can be used to troubleshoot and mitigate these issues:
158152
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.
159153

160154
> [!NOTE]
161-
>
162155
> - 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).
163156
> - 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.
164157
165158
To run the client analyzer for troubleshooting performance issues, see [Run the client analyzer on macOS and Linux](run-analyzer-macos-linux.md).
166159

167-
> [!NOTE]
168-
> In case after following the above steps, the performance problem persists, please contact customer support for further instructions and mitigation.
160+
## Configure Global Exclusions for better performance
161+
162+
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). IF you still have performace issues, contact support for further instructions and mitigation.
169163

170164
## Troubleshoot AuditD performance issues
171165

@@ -181,54 +175,33 @@ To run the client analyzer for troubleshooting performance issues, see [Run the
181175

182176
In certain server workloads, two issues might be observed:
183177

184-
- **High CPU** resource consumption from ***mdatp_audisp_plugin*** process.
178+
- `High CPU` resource consumption from `mdatp_audisp_plugin` process.
185179

186-
- ***/var/log/audit/audit.log*** becoming large or frequently rotating.
180+
- `/var/log/audit/audit.log` becoming large or frequently rotating.
187181

188-
These issues may occur on servers with many events flooding AuditD.
182+
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.
189183

190-
> [!NOTE]
191-
> As a best practice, we recommend to configure AuditD logs to rotate when the maximum file size limit is reached.
192-
>
193-
> This will prevent AuditD logs accumulating in a single file and the rotated log files can be moved out to save disk space.
194-
>
195-
> 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.
184+
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.
196185

197-
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.
198-
199-
To troubleshoot such issues, begin by [collecting MDEClientAnalyzer logs](run-analyzer-macos-linux.md) on the sample affected server.
200-
201186
> [!NOTE]
202-
> 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.
203-
>
204-
> That there are additional configurations that can affect AuditD subsystem CPU strain.
205-
>
206-
> 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.
207-
>
208-
> However, this means that some events may be dropped during peak CPU consumption.
187+
> 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.
209188
210189
### XMDEClientAnalyzer
211190

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

214-
- auditd_info.txt
215-
- auditd_log_analysis.txt
193+
- `auditd_info.txt`
194+
- `auditd_log_analysis.txt`
216195

217196
#### auditd_info.txt
218197

219-
Contains general AuditD configuration and will display:
198+
Contains general AuditD configuration and displays the following information:
220199

221200
- What processes are registered as AuditD consumers.
222201

223-
- **Auditctl -s** output with **enabled=2**
224-
225-
- Suggests auditd is in immutable mode (requires restart for any config changes to take effect).
226-
227-
- **Auditctl -l** output
202+
- `Auditctl -s` output with `enabled=2` (Suggests auditd is in immutable mode (requires restart for any config changes to take effect.)
228203

229-
- 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").
230-
231-
- Will show which rules are related to Microsoft Defender for Endpoint.
204+
- `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.)
232205

233206
#### auditd_log_analysis.txt
234207

@@ -250,23 +223,23 @@ Contains important aggregated information that is useful when investigating Audi
250223
251224
### Exclusion Types
252225

253-
The XMDEClientAnalyzer support tool contains syntax that can be used to add AuditD exclusion configuration rules:
226+
The XMDEClientAnalyzer support tool contains syntax that can be used to add AuditD exclusion configuration rules.
254227

255228
AuditD exclusion – support tool syntax help:
256229

257230
:::image type="content" source="media/auditd-exclusion-support-tool-syntax-help.png" alt-text="syntax that can be used to add AuditD exclusion configuration rules" lightbox="media/auditd-exclusion-support-tool-syntax-help.png":::
258231

259232
**By initiator**
260233

261-
- **-e/ -exe** full binary path > Removes all events by this initiator
234+
- `-e/ -exe` full binary path > Removes all events by this initiator
262235

263236
**By path**
264237

265-
- **-d / -dir** full path to a directory > Removes filesystem events targeting this directory
238+
- `-d / -dir` full path to a directory > Removes filesystem events targeting this directory
266239

267240
Examples:
268241

269-
If "`/opt/app/bin/app`" writes to "`/opt/app/cfg/logs/1234.log`", then you can use the support tool to exclude with various options:
242+
If `/opt/app/bin/app` writes to `/opt/app/cfg/logs/1234.log`, then you can use the support tool to exclude with various options:
270243

271244
`-e /opt/app/bin/app`
272245

@@ -313,4 +286,5 @@ When the ratelimit is enabled a rule will be added in AuditD to handle 2500 even
313286
## See also
314287

315288
- [Investigate agent health issues](health-status.md)
289+
316290
[!INCLUDE [Microsoft Defender for Endpoint Tech Community](../includes/defender-mde-techcommunity.md)]

0 commit comments

Comments
 (0)