Skip to content

Commit 48ee3a4

Browse files
Minor changes
1 parent c385e84 commit 48ee3a4

File tree

1 file changed

+47
-57
lines changed

1 file changed

+47
-57
lines changed

defender-endpoint/linux-support-perf.md

Lines changed: 47 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Depending on the applications that you are running and your device characteristi
3636
> [!WARNING]
3737
> Before starting, **make sure that other security products are not currently running on the device**. Multiple security products may conflict and impact the host performance.
3838
39-
There are three distinct ways to troubleshoot noisy processes and directories using exclusions provided by the Diagnostic tools from Microsoft Defender for Endpoint on Linux:
39+
There are three distinct ways to troubleshoot noisy processes and directories using the Diagnostic tools from Microsoft Defender for Endpoint on Linux:
4040
1. Using Real-time Protection Statistics
4141
2. Using Hot Event Sources
4242
3. Using eBPF Statistics
@@ -103,47 +103,46 @@ The following steps can be used to troubleshoot and mitigate these issues:
103103
104104
The output of this command shows all processes and their associated scan activity.
105105

106-
3. On your Linux system, download the sample Python parser **high_cpu_parser.py** using the command:
106+
3. Type the following commands:
107107

108108
```bash
109-
wget -c https://raw.githubusercontent.com/microsoft/mdatp-xplat/master/linux/diagnostic/high_cpu_parser.py
109+
mdatp diagnostic real-time-protection-statistics --sort --top 4
110110
```
111-
112-
The output of this command should be similar to the following:
111+
The output of the which is a list of the top 4 contributors to performance issues. For example, the output of the command will be something like the following:
113112

114113
```console
115-
--2020-11-14 11:27:27-- https://raw.githubusercontent.com/microsoft.mdatp-xplat/master/linus/diagnostic/high_cpu_parser.py
116-
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.xxx.xxx
117-
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)| 151.101.xxx.xxx| :443... connected.
118-
HTTP request sent, awaiting response... 200 OK
119-
Length: 1020 [text/plain]
120-
Saving to: 'high_cpu_parser.py'
121-
100%[===========================================>] 1,020 --.-K/s in 0s
114+
=====================================
115+
Process id: 560
116+
Name: NetworkManager
117+
Path: "/usr/sbin/NetworkManager"
118+
Total files scanned: 261
119+
Scan time (ns): "3070788919"
120+
Status: Active
121+
=====================================
122+
Process id: 1709561
123+
Name: snapd
124+
Path: "/snap/snapd/23545/usr/lib/snapd/snapd"
125+
Total files scanned: 247
126+
Scan time (ns): "19926516003"
127+
Status: Active
128+
=====================================
129+
Process id: 596
130+
Name: systemd-logind
131+
Path: "/usr/lib/systemd/systemd-logind"
132+
Total files scanned: 29
133+
Scan time (ns): "716836547"
134+
Status: Active
135+
=====================================
136+
Process id: 1977683
137+
Name: cupsd
138+
Path: "/usr/sbin/cupsd"
139+
Total files scanned: 20
140+
Scan time (ns): "985110892"
141+
Status: Active
142+
=====================================
122143
```
123144

124-
4. Type the following commands:
125-
126-
```bash
127-
mdatp diagnostic real-time-protection-statistics --output json | python high_cpu_parser.py
128-
```
129-
130-
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:
131-
132-
```console
133-
... > mdatp diagnostic real-time-protection-statistics --output json | python high_cpu_parser.py | head
134-
27432 None 76703
135-
73467 actool 1249
136-
73914 xcodebuild 1081
137-
73873 bash 1050
138-
27475 None 836
139-
1 launchd 407
140-
73468 ibtool 344
141-
549 telemetryd_v1 325
142-
4764 None 228
143-
125 CrashPlanService 164
144-
```
145-
146-
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).
145+
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 (carefully evaluate if it is safe to exclude). For more information, see [Configure and validate exclusions for Defender for Endpoint on Linux](linux-exclusions.md).
147146

148147
> [!NOTE]
149148
> 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.
@@ -266,16 +265,25 @@ This is the output saved in the hot event source report in json;
266265
"authCount": "5127",
267266
"csId": "",
268267
"notifyCount": "0",
269-
"path": "/usr/lib/postgresql/12/bin/postgres (deleted)",
268+
"path": "/usr/lib/postgresql/12/bin/postgres",
270269
"pidCount": "2144",
271270
"teamId": ""
272271
}
273272
]
274273
}
275274
```
276-
In this example, after 18s the command shows that the executables; /usr/lib/postgresql/12/bin/psql and /usr/lib/postgresql/12/bin/postgres (deleted) generate the most activity.
275+
In this example, after 18s the command shows that the executables; /usr/lib/postgresql/12/bin/psql and /usr/lib/postgresql/12/bin/postgres generate the most activity.
276+
277+
Once you've finished the investigation, you can change the log level back to "info".
278+
279+
```bash
280+
sudo mdatp log level set --level info
281+
```
282+
```console
283+
Log level configured successfully
284+
```
277285

278-
To improve the performance of Defender for Endpoint on Linux, locate the path with the highest number in the count row and add a global process exclusion (if it's an executable) or a global file/folder exclusion (if it's a file) for it. For more information, see [Configure and validate exclusions for Defender for Endpoint on Linux](linux-exclusions.md).
286+
To improve the performance of Defender for Endpoint on Linux, locate the path with the highest number in the count row and add a global process exclusion (if it's an executable) or a global file/folder exclusion (if it's a file) for it (carefully evaluate if it is safe to exclude). For more information, see [Configure and validate exclusions for Defender for Endpoint on Linux](linux-exclusions.md).
279287

280288
## Troubleshoot performance issues using eBPF Statistics
281289

@@ -313,7 +321,7 @@ To collect current statistics using eBPF statistics, run:
313321
```
314322
This command monitors the system for 20 seconds and shows the results. Here the top initiator path (postgresql/12/bin/psql) shows the path of the process that generated the most system calls.
315323

316-
To improve the performance of Defender for Endpoint on Linux, locate the one with the highest `count` in the `Top initiator path` row and add a global process exclusion for it. For more information, see [Configure and validate exclusions for Defender for Endpoint on Linux](linux-exclusions.md).
324+
To improve the performance of Defender for Endpoint on Linux, locate the one with the highest `count` in the `Top initiator path` row and add a global process exclusion for it (carefully evaluate if it is safe to exclude). For more information, see [Configure and validate exclusions for Defender for Endpoint on Linux](linux-exclusions.md).
317325

318326
## Troubleshoot performance issues using Microsoft Defender for Endpoint Client Analyzer
319327

@@ -332,24 +340,6 @@ To run the client analyzer for troubleshooting performance issues, see [Run the
332340

333341
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 performance issues, contact support for further instructions and mitigation.
334342

335-
### Rate Limiter
336-
337-
The XMDEClientAnalyzer support tool contains syntax that can be used to limit the number of events being reported by the auditD plugin. This option will set the rate limit globally for AuditD causing a drop in all the audit events.
338-
339-
> [!NOTE]
340-
> This functionality should be carefully used as limits the number of events being reported by the auditd subsystem as a whole. This the number of events for other subscribers as well.
341-
342-
The ratelimit option can be used to enable/disable this rate limit.
343-
344-
Enable: `./mde_support_tool.sh ratelimit -e true`
345-
346-
Disable: `./mde_support_tool.sh ratelimit -e false`
347-
348-
When the ratelimit is enabled a rule will be added in AuditD to handle 2500 events/sec.
349-
350-
> [!NOTE]
351-
> Please contact Microsoft support if you need assistance with analyzing and mitigating AuditD related performance issues, or with deploying AuditD exclusions at scale.
352-
353343
## See also
354344

355345
- [Investigate agent health issues](health-status.md)

0 commit comments

Comments
 (0)