| 1 | # Agent Performance Optimization Guide |
| 2 | |
| 3 | While Netdata Agents work seamlessly out-of-the-box with comprehensive monitoring, you can tune their configuration for better performance when needed. |
| 4 | |
| 5 | ## Why optimize your Agent |
| 6 | |
| 7 | By default, your Netdata Agent provides: |
| 8 | |
| 9 | - **Automatic Application Discovery**: Continuously detects and monitors applications on your node |
| 10 | - **Real-time Metric Collection**: Collects metrics every second |
| 11 | - **Health Monitoring**: Actively tracks health status with built-in alerting |
| 12 | - **Machine Learning**: Trains anomaly detection models for each metric ([Anomaly Detection](/src/ml/README.md)) |
| 13 | |
| 14 | These features deliver comprehensive monitoring but consume system resources. You might need to optimize when running Agents on resource-constrained systems or when scaling your monitoring infrastructure. |
| 15 | |
| 16 | :::note |
| 17 | |
| 18 | See [Resource Utilization](/docs/netdata-agent/sizing-netdata-agents/README.md) for detailed Agent resource requirements. |
| 19 | |
| 20 | ::: |
| 21 | |
| 22 | ## How to optimize performance |
| 23 | |
| 24 | Here's how each optimization strategy reduces resource usage: |
| 25 | |
| 26 | | Optimization Strategy | Reduces CPU | Reduces RAM | Reduces Disk IO | |
| 27 | |-----------------------------------------------------------------------|-------------|-------------|-----------------| |
| 28 | | [Set up Parent-Child architecture](#set-up-parent-child-architecture) | ✓ | ✓ | ✓ | |
| 29 | | [Disable unneeded collectors](#disable-unneeded-collectors) | ✓ | ✓ | ✓ | |
| 30 | | [Reduce collection frequency](#reduce-collection-frequency) | ✓ | | ✓ | |
| 31 | | [Adjust metric retention](#adjust-metric-retention) | | ✓ | ✓ | |
| 32 | | [Switch to RAM mode](#switch-to-ram-mode) | | ✓ | ✓ | |
| 33 | | [Turn off ML on Children](#turn-off-ml-on-children) | ✓ | | | |
| 34 | |
| 35 | ## Set up Parent-Child architecture |
| 36 | |
| 37 | Transform your monitoring by using Parent nodes as centralization points. Parents collect and aggregate data from multiple Child nodes, significantly reducing the load on individual systems. |
| 38 | |
| 39 | In this setup: |
| 40 | |
| 41 | - **Children** stream their metrics to Parents instead of storing everything locally |
| 42 | - **Parents** handle data aggregation, storage, and dashboard queries |
| 43 | - **You** access all metrics through the Parent nodes |
| 44 | |
| 45 | :::tip |
| 46 | This architecture works especially well in production environments where you monitor many systems. Learn more in our [Centralization Points documentation](/docs/deployment-guides/deployment-with-centralization-points.md). |
| 47 | ::: |
| 48 | |
| 49 | ## Disable unneeded collectors |
| 50 | |
| 51 | Reduce resource usage by turning off [Plugins or Collectors](/src/collectors/README.md) you don't need. |
| 52 | |
| 53 | :::warning Important |
| 54 | Only active collectors consume resources. Inactive plugins and collectors shut down automatically, so you only save resources by disabling those currently running and collecting metrics. |
| 55 | ::: |
| 56 | |
| 57 | Follow our [configuration guide](/src/collectors/REFERENCE.md) to identify and disable specific collectors. |
| 58 | |
| 59 | ## Reduce collection frequency |
| 60 | |
| 61 | Save CPU and disk IO by collecting metrics less frequently. If you don't need per-second precision, or if your Agent consumes too much CPU during periods of low dashboard activity, increase the collection interval. |
| 62 | |
| 63 | This change: |
| 64 | |
| 65 | - Significantly reduces CPU usage |
| 66 | - Decreases disk write operations |
| 67 | - Maintains meaningful monitoring capabilities |
| 68 | |
| 69 | Learn how to adjust collection frequency in our [configuration guide](/src/collectors/REFERENCE.md). |
| 70 | |
| 71 | ## Adjust metric retention |
| 72 | |
| 73 | Control memory and disk usage by changing how long your Agent stores historical data. Shorter retention periods mean: |
| 74 | |
| 75 | - Less RAM needed for in-memory metrics |
| 76 | - Reduced disk space requirements |
| 77 | - Faster Agent startup times |
| 78 | |
| 79 | Configure retention settings using our [database configuration guide](/src/database/CONFIGURATION.md). |
| 80 | |
| 81 | ## Switch to RAM mode |
| 82 | |
| 83 | For IoT devices and Child nodes in [Parent-Child setups](/docs/deployment-guides/deployment-with-centralization-points.md), switch to RAM mode to eliminate disk operations entirely. This mode: |
| 84 | |
| 85 | - Stores all metrics in memory only |
| 86 | - Eliminates disk IO for metric storage |
| 87 | - Significantly reduces overall resource usage |
| 88 | |
| 89 | :::tip |
| 90 | |
| 91 | Since Child nodes stream metrics to Parents, they don't need persistent local storage. RAM mode is ideal for this use case. |
| 92 | |
| 93 | ::: |
| 94 | |
| 95 | Set up RAM mode following our [database configuration guide](/src/database/CONFIGURATION.md). |
| 96 | |
| 97 | ## Turn off ML on Children |
| 98 | |
| 99 | Optimize resource allocation by running Machine Learning only where it matters most. We recommend: |
| 100 | |
| 101 | - **Enable ML on Parents**: They have the complete data picture and typically more resources |
| 102 | - **Disable ML on Children**: They focus on collecting and streaming metrics |
| 103 | |
| 104 | To disable ML, edit your configuration using [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-configuration-files): |
| 105 | |
| 106 | ```text |
| 107 | [ml] |
| 108 | enabled = no |
| 109 | ``` |
| 110 | |
| 111 | :::tip |
| 112 | |
| 113 | This configuration particularly benefits Child nodes, allowing them to focus on their primary role of collecting and streaming metrics to Parent nodes where ML analysis happens centrally. |
| 114 | |
| 115 | ::: |
| 116 | |
| 117 | ## Next steps |
| 118 | |
| 119 | 1. **Identify your needs**: Determine whether you need optimization for resource constraints or architectural efficiency |
| 120 | 2. **Start with architecture**: If monitoring multiple systems, implement Parent-Child setup first |
| 121 | 3. **Fine-tune individual Agents**: Apply specific optimizations based on each system's role and resources |
| 122 | 4. **Monitor the impact**: Use Netdata dashboards to confirm your optimizations haven't compromised monitoring visibility |