disable apps plugin pss mem by default (#21330)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Ilya Mashchenko committed
Nov 21, 2025 at 11:27 UTC
74623ba2d4b4b1ff9658ad715c46a926b64549aa
2 files changed
+39
-32
src/collectors/apps.plugin/README.md
+35
-28
@@ -146,10 +146,10 @@ interpreters: process1 process2 process3
146
147
#### Unix-like systems (Linux, FreeBSD, macOS)
148
149
-| Field | Description | Example |
150
-|----------|----------------------------------------------------------------------|----------------------|
151
-| comm | Process name (command) | `chrome` |
152
-| cmdline | Full command line with arguments | `/usr/bin/chrome --enable-features=...` |
149
+| Field | Description | Example |
150
+|---------|----------------------------------|-----------------------------------------|
151
+| comm | Process name (command) | `chrome` |
152
+| cmdline | Full command line with arguments | `/usr/bin/chrome --enable-features=...` |
153
154
> **Note:** On Linux specifically, the **comm** field is limited to 15 characters from `/proc/{PID}/comm`.
155
> `apps.plugin` attempts to obtain the full process name by searching for it in the **cmdline**.
@@ -157,11 +157,11 @@ interpreters: process1 process2 process3
157
158
#### Windows process fields
159
160
-| Field | Description | Example |
161
-|----------|----------------------------------------------------------------------|----------------------|
162
-| comm | Performance Monitor instance name (may include instance numbers) | `chrome#12` |
163
-| cmdline | Full path to the executable (without command line arguments) | `C:\Program Files\Google\Chrome\Application\chrome.exe` |
164
-| name | Friendly name from file description or service display name | `Google Chrome` |
160
+| Field | Description | Example |
161
+|---------|------------------------------------------------------------------|---------------------------------------------------------|
162
+| comm | Performance Monitor instance name (may include instance numbers) | `chrome#12` |
163
+| cmdline | Full path to the executable (without command line arguments) | `C:\Program Files\Google\Chrome\Application\chrome.exe` |
164
+| name | Friendly name from file description or service display name | `Google Chrome` |
165
166
> On Windows:
167
> - All pattern types (exact, prefix, suffix, substring) also match against the **name** field
@@ -180,14 +180,15 @@ You can use asterisks (`*`) to create patterns:
180
> - **Netdata v2.5.2 and earlier**: Windows patterns match against `comm` and `cmdline` fields
181
> - **Netdata v2.5.3 and later**: Windows patterns match against `comm`, `cmdline`, and `name` (friendly name) fields
182
183
-| Mode | Pattern | Description | Unix-like | Windows |
184
-|-----------|-------------|---------------------------------------------|-----------|---------|
185
-| exact | `firefox` | Matches **comm** exactly | ✓ Yes | ✓ Yes |
186
-| prefix | `firefox*` | Matches **comm** starting with firefox | ✓ Yes | ✓ Yes |
187
-| suffix | `*fox` | Matches **comm** ending with fox | ✓ Yes | ✓ Yes |
188
-| substring | `*firefox*` | Searches within **cmdline** | ✓ Yes (full command line) | ✓ Yes (full path) |
183
+| Mode | Pattern | Description | Unix-like | Windows |
184
+|-----------|-------------|----------------------------------------|---------------------------|-------------------|
185
+| exact | `firefox` | Matches **comm** exactly | ✓ Yes | ✓ Yes |
186
+| prefix | `firefox*` | Matches **comm** starting with firefox | ✓ Yes | ✓ Yes |
187
+| suffix | `*fox` | Matches **comm** ending with fox | ✓ Yes | ✓ Yes |
188
+| substring | `*firefox*` | Searches within **cmdline** | ✓ Yes (full command line) | ✓ Yes (full path) |
189
190
**Note on substring matching (`*pattern*`):**
191
+
192
- On Unix-like systems: Searches within the full command line including arguments
193
- On Windows: Searches within the full executable path (e.g., `C:\Program Files\Mozilla Firefox\firefox.exe`)
194
@@ -200,11 +201,13 @@ You can use asterisks (`*`) to create patterns:
201
#### Windows default grouping behavior
202
203
On Windows, when a process doesn't match any pattern in `apps_groups.conf`:
204
+
205
- The **name** field (friendly name from file description or service display name) is used as the default group/category if available
206
- If no **name** field exists, the **comm** field is used
207
- This provides better default grouping for Windows services and applications with descriptive names
208
209
For example, a process might have:
210
+
211
- **comm**: `svchost`
212
- **name**: `Windows Update`
213
- **Default category**: `Windows Update` (uses the friendly name)
@@ -251,15 +254,15 @@ You can use the Netdata `processes` function to verify that your `apps_groups.co
254
255
1. **Access the processes function** through Netdata Cloud (required for security reasons)
256
2. **Review the output** to see:
254
- - Current running processes with their `comm`, `cmdline`, and (on Windows) `name` fields
255
- - The **Category** column shows which group from `apps_groups.conf` each process has been assigned to
256
- - Resource utilization for each process
257
+ - Current running processes with their `comm`, `cmdline`, and (on Windows) `name` fields
258
+ - The **Category** column shows which group from `apps_groups.conf` each process has been assigned to
259
+ - Resource utilization for each process
260
261
3. **Troubleshooting tips**:
259
- - If a process shows the wrong Category, check the exact process name in the function output
260
- - On Windows, remember that the `name` field is used for default categories but NOT for pattern matching
261
- - Remember that the first matching pattern wins - check your pattern order
262
- - For inherited groups, verify the parent process has the correct Category
262
+ - If a process shows the wrong Category, check the exact process name in the function output
263
+ - On Windows, remember that the `name` field is used for default categories but NOT for pattern matching
264
+ - Remember that the first matching pattern wins - check your pattern order
265
+ - For inherited groups, verify the parent process has the correct Category
266
267
There are a few command line options you can pass to `apps.plugin`. The list of available options can be acquired with the `--help` flag.
268
The options can be set in the `netdata.conf` using the [`edit-config` script](/docs/netdata-agent/configuration/README.md).
@@ -275,7 +278,7 @@ For example, to disable user and user group charts you would set:
278
279
On Linux systems with kernel 4.14 or later, `apps.plugin` uses Proportional Set Size (PSS) data from `/proc/<pid>/smaps_rollup` to provide more accurate memory usage estimates for processes that heavily use shared memory (e.g., databases, shared memory applications).
280
278
-**By default, PSS sampling is enabled with a 5-minute refresh interval.** This provides better accuracy than raw RSS (Resident Set Size), which can overstate memory usage for processes sharing memory pages. The plugin periodically samples PSS values and uses them to scale the shared memory portion of RSS, providing a more accurate estimate without the overhead of reading smaps on every iteration.
281
+**By default, PSS sampling is disabled**. When disabled, memory charts show traditional RSS (Resident Set Size), which may overstate usage for processes sharing memory pages. Enabling PSS sampling allows the plugin to periodically sample PSS values and use them to scale the shared portion of RSS, providing a significantly more accurate estimate without the overhead of reading smaps on every iteration.
282
283
#### Configuration
284
@@ -287,28 +290,32 @@ The `--pss` option controls PSS sampling behavior:
290
```
291
292
**Valid values:**
293
+
294
- Duration (e.g., `5m`, `300s`, `10m`): Sets the refresh interval for PSS sampling. Lower values provide more accurate estimates but increase CPU overhead.
295
- `off` or `0`: Completely disables PSS sampling. Memory charts will show traditional RSS-based measurements.
296
293
-**Default:** `5m` (5 minutes)
297
+**Default:** `off`
298
299
**How it works:**
300
+
301
- `apps.plugin` uses adaptive sampling that alternates between two strategies each iteration:
297
- - **Delta-based**: Prioritizes processes with largest shared memory changes (refreshes big memory consumers within seconds)
298
- - **Age-based**: Prioritizes processes with oldest samples (ensures all processes refreshed within 2× the interval)
302
+ - **Delta-based**: Prioritizes processes with largest shared memory changes (refreshes big memory consumers within seconds)
303
+ - **Age-based**: Prioritizes processes with oldest samples (ensures all processes refreshed within 2× the interval)
304
- The sampled PSS/RSS ratio is cached and applied to subsequent RSS readings to estimate current memory usage
305
- This approach ensures rapid response to significant memory changes while guaranteeing bounded staleness for all processes
306
- When disabled (`--pss 0` or `--pss off`), no PSS sampling occurs and estimated memory charts are not shown
307
308
**Performance considerations:**
309
+
310
- Reading `/proc/<pid>/smaps_rollup` is more expensive than reading `/proc/<pid>/status`
311
- Shorter refresh periods provide more accurate estimates but increase CPU usage
312
- On systems with thousands of processes, consider increasing the refresh period (e.g., `10m` or `15m`)
313
- For systems without significant shared memory usage, disabling PSS sampling (`--pss off`) reduces overhead
314
315
**Chart behavior:**
310
-- **Default (PSS enabled):** Shows both "Estimated memory usage (RSS with shared scaling)" and "Memory RSS usage" charts
311
-- **When disabled (`--pss 0`):** Shows only "Memory RSS usage" charts
316
+
317
+- **When PSS is enabled:** Shows both "Estimated memory usage (RSS with shared scaling)" and "Memory RSS usage" charts
318
+- **Default (PSS disabled):** Shows only "Memory RSS usage" charts
319
- The `processes` function API exposes additional columns (PSS, PssAge, SharedRatio) when PSS is enabled
320
321
### Integration with eBPF
src/collectors/apps.plugin/apps_plugin.c
+4
-4
@@ -381,7 +381,7 @@ cleanup:
381
static bool profile_speed = false;
382
static bool print_tree_and_exit = false;
383
#if (PROCESSES_HAVE_SMAPS_ROLLUP == 1)
384
-int pss_refresh_period = 300; // seconds
384
+int pss_refresh_period = 0; // disabled by default
385
#endif
386
387
static void parse_args(int argc, char **argv)
@@ -586,9 +586,9 @@ static void parse_args(int argc, char **argv)
586
" (default is %d seconds)\n"
587
"\n"
588
#if (PROCESSES_HAVE_SMAPS_ROLLUP == 1)
589
- " --pss TIME estimated memory interval (e.g. 5m, 300s)\n"
590
- " use 'off' to disable smaps sampling\n"
591
- " (default is 5 minutes)\n"
589
+ " --pss TIME enable estimated memory using PSS sampling at the given interval\n"
590
+ " (e.g. 5m, 300s). Use 'off' or '0' to disable.\n"
591
+ " (default is off)\n"
592
"\n"
593
#endif
594
#endif