Skip to main content

Collector sizing and scaling

How much CPU and memory the OpenTelemetry Collector needs depends on your traffic volume and on which pipeline features you run. The settings on this page apply to collectors running on a Kubernetes cluster and to collectors running on a standalone Linux or Windows host.

The most common failure mode is a collector pod that is OOMKilled at peak traffic. Almost always the fix is to make sure the pod has a memory limit set with enough headroom, because the Collector's built-in memory safeguards are calculated from that limit.

Set resource requests and limits​

The Collector's memory safeguards - the memory_limiter processor and GOMEMLIMIT - are both derived from the pod's memory limit. If no limit is set, neither can cap memory, and the pod can grow until the node OOM-kills it.

In the Coralogix otel-integration chart, the node agent (daemonset) and the cluster collector ship with a memory limit. The gateway and the standalone receiver may ship without one, so set requests and limits explicitly before you put them under load.

Coralogix's recommended starting point for a gateway, suggested in the chart's tail-sampling value files, is:

opentelemetry-gateway:
replicaCount: 3
resources:
requests:
cpu: 0.5
memory: 256Mi
limits:
cpu: 2
memory: 2G

For the standalone receiver, set the same keys under opentelemetry-receiver.

Adjust these values based on the signals below. For the current defaults of every component, see the otel-integration values.yaml.

Control memory use​

Three settings govern how much memory the Collector holds, and all of them assume a memory limit is set:

  • memory_limiter processor: Runs in every pipeline. By default it engages at about 80% of the pod's memory limit, with a 25% spike allowance, checked every 5 seconds. At the soft limit it refuses new data (applying backpressure to the sources); at the hard limit it forces garbage collection.
  • GOMEMLIMIT: Set to about 80% of the memory limit, so Go's garbage collector works harder before the pod reaches its limit.
  • Coralogix exporter sending queue: Holds a bounded queue of data in memory while it sends and retries (200 MiB per exporter by default). If you raise the queue size, the batch size, or the number of consumers, raise the pod's memory requests and limits to match, or the collector can OOM under a backlog.

Reduce CPU use​

Collector CPU is driven by how much data the pipeline touches and how often it touches it. The steps below are ordered to put the changes that usually recover the most CPU first, and to trim what you collect before you change how often you collect it. Work down the list and stop when the load is where you want it.

  1. Lower the debug exporter verbosity: At detailed the exporter serializes every record the pipeline carries and writes it out, so its cost scales with your full throughput. It is a diagnostic setting. Remove the debug exporter from the pipeline when you finish troubleshooting, or set verbosity: basic. The accepted values are basic (the default), normal, and detailed.
  2. Raise the filelog receiver poll_interval: The receiver checks every file in scope on each tick, and the default is 200ms. On a host with many log files, or files on a slow volume, this is often the largest single cost in the pipeline. Raise it to 5s on a host with many files, and higher where log latency is not critical. max_concurrent_files (default 1024) caps how many files the receiver reads at once; lower it when the host has far more files than the collector needs to read in parallel.
  3. Trim the scrape surface: Reduce what you collect before you change how often you collect it. A target that exposes thousands of series costs the collector on every tick no matter what the interval is. On Windows, windows_exporter takes its collector list from the ENABLED_COLLECTORS MSI property, so install it with the collectors you need rather than leaving the full set on. See Monitoring Windows server using OTel & Prometheus.
  4. Raise scrape and collection intervals: Collecting less often costs less CPU, and the work scales directly with the interval, so a collector set to 30s does twice the collection work it does at 1m. The prometheus receiver takes scrape_interval from its scrape configuration and inherits the global value, which defaults to 1m. The hostmetrics receiver's collection_interval also defaults to 1m. In the otel-integration chart, global.collectionInterval sets the interval for the receivers the chart configures; it defaults to 30s, and 15s is the lowest value Coralogix recommends.
  5. Set the batch processor values explicitly: A bare batch: entry in a hand-written config is not free. It falls back to the processor's upstream defaults, which flush every 200ms (timeout) or at 8192 records (send_batch_size) with no upper bound on a single export (send_batch_max_size: 0), so a low-volume collector exports five small batches a second and pays the per-export overhead on each one. Set send_batch_size: 1024, send_batch_max_size: 2048, and timeout: 1s, which is what the otel-integration chart configures. See batch sizing.
  6. Account for pipeline features: Resource detection, span metrics, tail sampling, and Kubernetes metadata enrichment each do per-record work. Capacity planning covers which of these to account for before you size a collector.

Standalone hosts​

On a Linux or Windows host there are no chart defaults to inherit, so every setting above is one you write yourself in config.yaml. Three things apply only to this deployment:

  • Keep the collector log level at info: service.telemetry.logs.level at debug writes a line per pipeline operation and is expensive on Windows in particular. Leave it at info in production.
  • Enable only the hostmetrics scrapers you use: Each scraper in the scrapers list is collected on every collection_interval tick, so leave the rest out.
  • Confirm the collector is the process using the CPU: On Windows, real-time antivirus scanning of a log directory that the filelog receiver reads can saturate disk I/O and make everything touching those files look CPU-bound. Check the per-process view in Resource Monitor, along with disk queue length and latency on the log path, before you change the pipeline.

Add these keys to your existing config.yaml:

receivers:
filelog:
poll_interval: 5s
max_concurrent_files: 256

processors:
batch:
send_batch_size: 1024
send_batch_max_size: 2048
timeout: 1s

service:
telemetry:
logs:
level: info

Keep batches within endpoint limits​

The otel-integration chart's default batch settings (send_batch_size: 1024, send_batch_max_size: 2048, timeout: 1s) balance throughput against memory. Larger batches use more memory and must stay within the Coralogix endpoint limits and quotas: a hard limit of 10 MB per request, 2 MB recommended. Raising batch or queue sizes to push more data through is a common cause of memory pressure.

Scale out​

The gateway and receiver scale horizontally: add replicas and let the agents load-balance across them.

  • Replicas: Increase the replica count for the gateway and receiver as traffic grows (the recommended starting point above uses 3).
  • Autoscaling: The chart supports a Horizontal Pod Autoscaler for deployment-mode collectors, but it is off by default. Enable it if your load varies through the day.
  • When to scale: Add capacity when the exporter queue is consistently 60-70% full, or when the refused or enqueue-failed metrics below start rising.

Signals to watch​

Use the Collector's own metrics to tell whether a collector is under-provisioned and where its CPU time is going. The Collector serves them in Prometheus format at http://127.0.0.1:8888/metrics on the collector host. To scrape them from elsewhere, set service.telemetry.metrics to bind a routable address.

SignalWhat it means
otelcol_exporter_queue_size vs otelcol_exporter_queue_capacityThe queue is filling up. Scale out at roughly 60-70% of capacity.
otelcol_exporter_enqueue_failed_*, otelcol_exporter_send_failed_*The collector is dropping data or failing to send it.
otelcol_processor_memory_limiter_refused_spans (and the log record and metric point equivalents)memory_limiter is applying backpressure because memory is tight.
k8s.container.status.last_terminated_reason = OOMKilledA pod is being killed for exceeding its memory limit. Raise the limit or scale out.
otelcol_process_cpu_secondsTotal user and system CPU time the collector has consumed. Take its rate to get the CPU cores in use, and compare that against the pod's CPU limit, or the host's core count, before and after each change in Reduce CPU use.
otelcol_receiver_accepted_spans, otelcol_receiver_accepted_log_records, otelcol_receiver_accepted_metric_pointsHow much data each receiver is pushing into the pipeline. Broken down by receiver, this says which one the CPU time is going to.

Capacity planning​

Coralogix does not publish a fixed throughput-to-resources table, because actual CPU and memory depend on your signal mix (logs, metrics, spans) and on the pipeline features you enable, such as resource detection, span metrics, tail sampling, and Kubernetes metadata enrichment. Start from the defaults above, watch the signals, and adjust. For general guidance on scaling the Collector, see the upstream OpenTelemetry Scaling the Collector documentation.

Additional resources​

Last updated on