This guide provides recommended CPU and memory limits for the Kubernetes Log module and shows benchmark results across log throughput, record sizes, node types, and pod counts. Use it to choose limits that match your environment.
The Kubernetes Log module runs as a DaemonSet, so the recommendations in this guide apply to each Log module pod on each node.
By default, the Log module reads and parses up to 500 MB of raw log data per polling interval across all monitored files. This limit applies to raw log line data only and doesn't include the enrichment that Dynatrace adds to log records. For the polling interval and how the Log module reads log files, see Polling intervals. For other limits, see Log module storage and processing limits.
The test results in this guide include full-load scenarios, where the Log module processes this maximum.
The following factors can increase the CPU and memory that the Log module needs:
Log volume: The number of log records per minute. At the same data volume, smaller log records mean more records to process, and more CPU usage.
Sensitive data masking: The number and complexity of masking rules.
Log filtering: The number and complexity of filtering rules.
Pod count: The total number of pods that the Kubelet reports on the node, including:
The following CPU and memory limits are suitable for most use cases. Set them in the Kubernetes resource specification for the Log module container.
| CPU limit | Memory limit |
|---|---|
1000m (1 core)1 | 512 MiB |
The test results show that the Log module uses less than one core under the tested workloads. However, we recommend allowing additional CPU headroom when you use many resource-intensive sensitive data masking rules or when inline enrichment adds extra processing.
Reducing these limits might delay log ingestion. To find the scenario that best matches your environment, review the benchmark results.
Set the resources in the spec.templates.logMonitoring.resources section of your DynaKube custom resource. These resources apply to both the init container and the main container of the Log module. For all available parameters, see DynaKube parameters.
apiVersion: dynatrace.com/v1beta6kind: DynaKubemetadata:name: dynakubenamespace: dynatracespec:apiUrl: https://ENVIRONMENTID.live.dynatrace.com/apilogMonitoring: {}templates:logMonitoring:imageRef:repository: public.ecr.aws/dynatrace/dynatrace-logmoduletag: <tag>resources:limits:cpu: 1000mmemory: 512Mi
If you set only limits, Kubernetes uses the same values as requests and reserves them on each node. To reserve less, set lower requests explicitly, based on the benchmark results for your workload.
This section shows how Log module CPU and memory usage change with log throughput, log record size, and the number of pods on a node. Use these results to find the scenario closest to your environment and to check whether the recommended limits fit your workload.
Expect higher resource usage when you enable additional features, such as complex sensitive data masking rules or extensive Kubernetes enrichment.
The following tests were run:
| Test | What varies | What's fixed |
|---|---|---|
Throughput (50, 150, 300, and 500 MB/min) and record size (500 B, 2.5 KB, and 4 KB) | Number of log-generating pods: 1 (2 for the 500 MB/min tests) | |
Number of pods on the node: 100, 200, 400, and 800 | Throughput of 300 MB/min, 2.5 KB records, and 1 log-generating pod |
Each test ran on the following Amazon EC2 instance types:
| Architecture | Instance types |
|---|---|
x86-64 |
|
arm64 |
|
The following tables show CPU and memory usage for each combination of target throughput and log record size. Each cell shows CPU usage in millicores and memory usage in MiB, as CPU / memory. 1000m equals one core.
| Throughput | 500 B records (CPU / memory) | 2.5 KB records (CPU / memory) | 4 KB records (CPU / memory) |
|---|---|---|---|
50 MB/min | 83.5m / 125.2 MiB | 35.6m / 99.8 MiB | 29.7m / 100.0 MiB |
150 MB/min | 217.0m / 136.6 MiB | 95.8m / 104.8 MiB | 84.1m / 103.2 MiB |
300 MB/min | 400.8m / 142.6 MiB | 187.2m / 107.5 MiB | 161.3m / 104.9 MiB |
500 MB/min | 513.8m / 396.2 MiB | 280.0m / 109.6 MiB | 257.4m / 95.0 MiB |
The total number of pods on a node, including completed and running pods, increases CPU and memory usage. The following table shows CPU and memory usage by instance type and pod count for a fixed workload of 300 MB/min with 2.5 KB log records, generated by one pod. Each cell shows CPU usage in millicores and memory usage in MiB.
| Instance | 100 pods (CPU / memory) | 200 pods (CPU / memory) | 400 pods (CPU / memory) | 800 pods (CPU / memory) |
|---|---|---|---|---|
| 193.1m / 129.0 MiB | 187.7m / 161.4 MiB | 173.0m / 228.5 MiB | 282.1m / 427.0 MiB |
| 207.6m / 146.6 MiB | 192.0m / 172.4 MiB | 225.0m / 229.4 MiB | 383.2m / 468.5 MiB |
| 173.8m / 136.2 MiB | 203.9m / 147.4 MiB | 188.1m / 243.2 MiB | 259.0m / 455.7 MiB |
| 182.9m / 137.9 MiB | 192.3m / 171.9 MiB | 193.9m / 263.0 MiB | 228.4m / 440.0 MiB |
Check the actual resource usage of the Log module pods with the following built-in Kubernetes metrics:
dt.kubernetes.container.cpu_usage: CPU usage of the container.dt.kubernetes.container.memory_working_set: Memory working set of the container.Compare these values with the resources you configured to see whether your requests and limits match what the workload uses.