Sizing OpenTelemetry Collector memory and batching for bursts
Platform teams whose Collectors restart or drop data during traffic spikes usually have a sizing problem in two places: the memory_limiter processor and the batch processor. Together they decide whether a Collector refuses data under pressure or runs out of memory and gets killed. The OpenTelemetry Collector is a vendor-neutral way to receive, process and export telemetry such as traces, metrics and logs. It can run as an agent next to workloads or as a gateway that accepts data from many sources, and both roles are exposed to bursts. You need to size memory and batching when you first place a Collector in a path that carries production volume, and again whenever traffic grows, a new signal is added, or a new exporter is attached.
Start by confirming the behavior of the components you plan to use. The batch processor is beta for traces, metrics and logs, and it ships in the core, contrib and Kubernetes distributions, so check the stability notes in its README before you rely on its defaults in production. Confirm which distribution you are running, since the same configuration keys may not be available in every build. Then decide where batching belongs in the pipeline: placing the batch processor late in each pipeline, just before exporters, is the usual starting point, but you should verify that choice against the processor documentation for your release rather than assume it.
Treat the memory limit as a deliberate budget, not a guess. Set the container memory limit first, then set memory_limiter thresholds below it so the Collector starts refusing data before the kernel terminates it. Watch otelcol_processor_refused_spans to see whether the limiter is already refusing data, and watch otelcol_exporter_queue_size against otelcol_exporter_queue_capacity to see whether exporters are falling behind. Load-test with a realistic burst profile in a staging environment, and record the thresholds and results in the runbook. The OpenTelemetry scaling guide lists these signals and is the right next read when you move from sizing to scaling decisions.
Where memory_limiter and batch sit in the pipeline
The pipeline starts at the receivers, which accept telemetry from applications and agents. Data then passes the memory_limiter processor, which is the first place to refuse data under pressure, and the batch processor, which groups data before export. The exporter sending queue holds batches while the back end is slow, and the back end is the last hop. Check the refused-spans counter after the memory_limiter, and the queue capacity and queue size signals on the exporter, because those show where data is being turned away or backing up.
Data flow through the Collector and the signals that show refusal and backlog.
How the memory_limiter refuses data under pressure
The memory_limiter processor checks the Collector's memory use on a regular interval and compares it against configured thresholds. When usage crosses the limit, the processor stops accepting new data from receivers and returns an error to the sender instead of letting the process grow until the operating system or container runtime kills it. The intent is controlled loss at the edge: the Collector stays up, keeps working through the data already in memory, and tells upstream senders that it is overloaded. Each signal type passes through its own refusal path, so the effect shows up in the metrics for the signal that was refused. Your job is to decide whether that trade is acceptable for each pipeline, because a refused batch is data your back end never sees unless the sender retries it.
The scaling guide ties this behavior to otelcol_processor_refused_spans, which counts spans the memory_limiter has refused. A rising value means the limiter is active and the Collector is under sustained pressure, not a one-off spike. Compare it with the equivalent counters for metrics and logs, and with exporter queue signals such as otelcol_exporter_queue_size. If refusals rise while exporter queues stay low, the bottleneck is inside the Collector's own processing. If queues are full as well, the back end or network is the constraint and raising memory alone will only move the failure point. Check these counters in the same dashboard so the cause is visible before you change any setting.
Confirm the exact threshold settings, including how the limit is expressed and how the spike allowance is calculated, against the current memory_limiter README in the Collector repository before you write them into configuration, since the option names and defaults can change between releases. Also confirm how refused data is reported to receivers on each protocol, because whether a sender retries depends on that response. Test the behavior under a controlled load in a non-production environment and watch the refused counters and restart count together. Record what happens to data during the test so the team knows what it will lose in a real burst.
Configuration options and when each fits
This table compares the four settings you tune to keep a Collector alive under bursts: memory_limiter, batch, the exporter sending queue, and the container memory limit. Read each row for when the setting fits and what it costs you, then confirm defaults in each component README before you set values.
| Option | When it fits | Trade-off |
|---|---|---|
| memory_limiter check interval and limits | Any Collector that can receive more data than it can export during a burst; set it early in the pipeline so it refuses data before memory runs out | A tight limit refuses data sooner and raises refused-data counts, while a loose limit risks an out-of-memory restart that drops everything in memory |
| memory_limiter check interval | Bursty workloads where memory climbs quickly between checks | Frequent checks react faster but add CPU overhead; infrequent checks can let memory overshoot the limit before refusal starts |
| batch send_batch_size and timeout | High-throughput pipelines where per-request overhead to the back end is significant and fewer, larger exports help | Larger batches hold more data in memory and delay export, so they raise memory use and latency; check the batch processor README for current defaults |
| batch placement in the pipeline | Place batch near the end of the pipeline, after filtering and sampling, so it groups data that will actually be sent | Batching before heavy filtering wastes work on data that is later dropped, and batching after the memory_limiter means limits must account for batched data |
| Exporter sending queue capacity | Exporters that see intermittent back-end slowness and need to absorb short spikes without blocking receivers | A larger queue holds more data in memory when the back end is slow and can delay signals that the Collector cannot export in time; watch queue size against capacity |
| Exporter queue size signals | Confirming whether exporters keep up, using otelcol_exporter_queue_size against otelcol_exporter_queue_capacity | A queue that stays near capacity means the exporter or back end is the bottleneck, so raising limits only buys time |
| Container memory limit (Kubernetes or VM) | Setting the orchestrator limit above the memory_limiter hard limit so the Collector can refuse data before the kernel kills it | A limit set too close to the memory_limiter values leaves no headroom for Go runtime overhead, and a limit far above them lets the process grow before it refuses data |
| Refused-data metrics | Confirming the memory_limiter is refusing data, using otelcol_processor_refused_spans and equivalents for metrics and logs | Refusals protect the Collector but mean data is lost at the sender unless retries are configured, so treat any sustained refusal as a sizing or scaling signal |
Which metrics show a Collector cannot keep up
A Collector that cannot keep up usually shows the strain in its own metrics before data is lost. The signals below sit at different points in the pipeline, from the memory_limiter at the receiver to the exporter queue and the back end, so each one points to a different fix.
Refused spans from the memory limiter
The metric otelcol_processor_refused_spans counts spans the memory_limiter rejected because the Collector was above its memory threshold. A rising count means the process is at its limit and receivers are pushing back on senders. Check the memory_limiter settings against the container memory limit first, then look for a burst source or a processor doing heavy work. Confirm the exact metric names and labels for your Collector version in the scaling guide before you build alerts on them.
Exporter queue capacity
The metric otelcol_exporter_queue_capacity reports how many items an exporter's sending queue can hold. It is a fixed setting, so it matters mainly as the denominator for queue fullness. Compare it with the queue size to judge headroom during a slow back end. If capacity is small for your peak batch volume, the queue fills quickly and data is dropped sooner.
Exporter queue size
The metric otelcol_exporter_queue_size shows how many items are waiting to be sent. A queue that stays near capacity, or grows steadily during normal traffic, means the exporter cannot keep up with what the receivers accept. Look at back-end latency and the exporter's concurrency and batch settings. A queue that drains between bursts is usually healthy, so the trend matters more than a single reading.
Container restarts and OOM kills
Container-level restarts and out-of-memory terminations show that the Collector hit its hard memory limit before the memory_limiter could slow intake. Kubernetes reports these as the container's last termination reason, and the container runtime logs them on hosts. Restarts without refused-data increases often mean the memory_limiter check interval is too slow or the limit is set above the container memory. Recheck the gap between the soft threshold and the container limit under load.
Back-end rejections and retries
When the back end returns errors such as throttling or rejected payloads, the exporter retries and its queue grows, which then shows up in the queue metrics. Count rejections separately from timeouts, since they point to different causes. Rejections often come from batches that are too large or too frequent for the back end's limits. Confirm those limits with the back-end vendor before you change batch sizes.
Where batching belongs in the pipeline and why order matters
Place the batch processor near the end of each pipeline, immediately before the exporters, and keep memory_limiter at or near the front. The order matters because the two processors do opposite jobs. memory_limiter decides whether the Collector accepts more data at all, so it has to see incoming data before anything else holds it in memory. batch gathers many small items into fewer, larger export requests, which reduces per-request overhead on the back end but also means data waits in the Collector until a batch fills or a timeout expires. Every processor placed before the limiter does work on data the limiter has not yet had a chance to refuse, so a burst can grow memory in those processors before protection engages.
The trade-off is latency against efficiency. A larger send_batch_size or a longer timeout produces fewer requests and usually better throughput to the back end, but it adds delay before data becomes visible and holds more data in memory during a burst. Treat batch size as something to tune against your own memory headroom and back-end limits, not a value to copy. The batch processor is in beta for traces, metrics and logs, so check its README for the status of the signal and distribution you run, and confirm the batch settings you plan to use against the version in production. Test the chosen order under a realistic load test before rollout.
Confirm the recommended processor ordering in the Collector documentation for the exact version you deploy, because guidance on placement and component stability changes between releases. Then check the Collector's own telemetry after a load test. Refused-data counters tell you whether the limiter engaged, and exporter queue metrics show whether the back end is keeping up with the batched output. If refusals appear while the back end is healthy, review processors that run ahead of the limiter first.
How to size memory limits and batch settings
This sequence turns a guess about Collector memory into a documented configuration that holds under a measured burst, with each setting tied to a number you observed. The output is a Collector sizing record that your platform team can reproduce and revisit when volume changes.
Measure baseline telemetry volume per Collector
Your platform or observability team records the steady-state volume each Collector handles, in spans, metric points and log records per second, along with average and peak payload sizes. Take the measurements from the Collector's own internal metrics and from the sending workloads, over a normal business cycle that includes known peaks. The step is done when you have a per-Collector table of normal and peak throughput that someone outside the team could read and question.
Set the container memory limit
The platform team sets a memory limit on the Collector container or pod based on the baseline table and the capacity of the nodes it will run on. Confirm the limit with your Kubernetes or VM administrators so the scheduler and the host both have room for other workloads. The step is done when the limit is written into the deployment manifest or configuration management code, and the team can name the node pool it fits on.
Set memory_limiter below the container limit
The Collector engineer configures the memory_limiter processor with thresholds that sit clearly below the container memory limit, so the processor starts refusing data before the kernel terminates the process. Place it first in each pipeline so it acts before other processors allocate memory. The step is done when the configuration file shows the limiter as the first processor and the thresholds are noted alongside the container limit they protect. Confirm the exact keys and their behavior against the Collector configuration documentation for your release.
Configure the batch processor
The engineer adds the batch processor after the memory_limiter and sets the batch size and timeout so that exporters receive requests of a useful size without holding data too long. Note that the batch processor is in beta for traces, metrics and logs, so check its stability entry in the README for the distribution you run. The step is done when each pipeline has a batch processor with recorded values and a reason for each value in the change record.
Load test a burst against the configuration
The test team sends a synthetic or replayed burst, well above the measured peak, to a Collector running the new configuration in a non-production environment that matches production resources. Record memory use, CPU use, throughput and any restarts over the full burst and the recovery period afterward. The step is done when you have a test report showing whether the Collector stayed up, how the limiter behaved and how long the backlog took to clear. Label any test traffic profile as illustrative if it is not drawn from your own environment.
Read refused-data and queue metrics
The engineer checks the Collector's internal metrics during the test and during normal operation. A rising otelcol_processor_refused_spans count indicates the memory_limiter is refusing data. The otelcol_exporter_queue_capacity and otelcol_exporter_queue_size metrics show whether exporters are falling behind the incoming flow. The step is done when the team has a dashboard or query that shows these signals side by side with memory use, and a written threshold for when someone is alerted.
Adjust settings and document the result
Based on the test and the metrics, the engineer changes the limiter thresholds, batch values or container limit, and reruns the burst test until the Collector keeps refusing little or no data at the expected peak. The team then writes a sizing record that lists the baseline, the container limit, the limiter and batch values, the test profile and the metrics to watch. The step is done when the record is stored with the configuration in version control and a named owner reviews it when telemetry volume changes.
Security and operational considerations for tuning
Changing memory limits and batch settings touches the same configuration files that control which interfaces the Collector listens on and how it authenticates. The cards below cover the security checks to run whenever you change sizing, so a tuning pass does not open endpoints or hide sensitive data.
Check listener bindings after every change
Server components such as receivers and extensions bind to localhost by default since v0.110.0, so the default is safe only if your configuration does not override it. When you edit receiver endpoints while adjusting sizing, confirm that you did not replace a localhost address with 0.0.0.0 or an empty host. Then verify from outside the host that the port is unreachable unless you intended it to be exposed.
Protect the configuration file
The Collector configuration holds exporter endpoints, credentials and TLS settings, so a sizing change made in a shared file or a ConfigMap can leak secrets to anyone with read access. Store the file under version control with restricted access, keep credentials in environment variables or a secrets manager, and encrypt the file at rest where your platform allows it. Review the diff for any secret that appears in plain text.
Authenticate every exposed receiver
If tuning means moving a receiver to a shared gateway that accepts traffic from more workloads, add authentication before the endpoint is reachable. Collector authenticator extensions can verify incoming connections, for example with OIDC, and the oauth2client extension can add credentials to outgoing exporter requests. Confirm which clients reach each receiver and reject anonymous traffic on any pool that spans teams.
Collector configuration docsRedact before data leaves the pipeline
A memory limiter that refuses data can hide sensitive-data problems, because a burst that is dropped never reaches the back end where someone would notice it. Use the redaction processor to remove sensitive attributes such as tokens or personal identifiers, and place it before any batch stage so redacted values never sit in a buffer. After a sizing change, compare sample payloads at the exporter with what applications emit.
Build only the components you need
Larger batch and queue settings often come with added processors or receivers that were tested in a broader distribution. Following the security guidance, build the Collector with only the components your pipeline uses through the Collector Builder. A smaller binary has fewer components to patch and review, and each change to the component list should be repeated in your sizing tests.
Questions teams ask before sizing Collector memory
What drives the effort and cost of sizing Collector memory and batching?
The effort follows from how many pipelines, signals and sources the Collectors carry, and how bursty that traffic is. Each receiver, exporter and processor adds something to test, and every back end that can slow down needs its own queue behavior checked. Load profiles matter most: a steady stream of metrics is easier to size than log traffic that spikes during deploys or incidents. Cost has two parts. The first is one-time work to measure load, set memory_limiter thresholds, choose batch sizes and prove the settings hold under a test burst. The second recurs when services, volumes or back ends change and the settings need review. Ask any provider to break the quote into load measurement, configuration changes, burst testing and handover, and to state what happens when the traffic model changes after go-live.
How long does Collector memory sizing take, and what does it depend on?
Duration depends on the environment and the evidence you already have, not on a fixed number. Teams with existing Collector metrics and a clear list of pipelines can move quickly. Teams that must first find out what telemetry they produce, where it goes and how it spikes need more time for discovery. Test windows also set the pace, because a burst test needs a realistic load source and a safe place to run it. Dependencies to plan for include access to the Collector's own metrics, a staging path that resembles production, change approval windows and the back end's ingest limits. Ask for a timeline that lists these dependencies separately so you can see which ones your team controls.
What does the sizing work need from our internal team?
It needs people who know the telemetry and the environment. Most of the work depends on four inputs:
- Owners of each service or source who can confirm expected log, trace and metric volumes and peak periods.
- Platform engineers who control where Collectors run, their container or VM resource limits and how they restart.
- Someone who can grant access to Collector internal metrics and the back-end dashboards that show rejected or throttled writes.
- An approver for configuration changes, since memory settings affect every signal that passes through the Collector.
Without these inputs, the team will end up guessing at peak load, which is the main reason sizing settings fail in production.
Can our own team size Collector memory without an outside partner?
Yes, a team with Collector experience and access to its own telemetry can do this work. The task is mostly measurement and disciplined change control: watch the Collector's own metrics, change one setting at a time, and test under realistic bursts. What usually makes it hard is time, not technique. Teams often lack a safe load-testing path, a record of peak periods, or an agreed rollback method. An outside partner adds value when those gaps are large or when the same sizing must be repeated across many clusters. Either way, the output should be written configuration, a documented traffic model and a test record that a future engineer can rerun.
How do we tell a Collector memory problem from a back-end problem?
Start with where the data stops. If the Collector's memory_limiter is refusing data, the metric otelcol_processor_refused_spans rises, which points to the Collector itself running out of headroom. If the Collector accepts data but exporters cannot keep up, the queue signals show it: otelcol_exporter_queue_size approaching otelcol_exporter_queue_capacity means the exporter is falling behind. A healthy Collector with a full exporter queue usually has a slow or throttling back end, not a memory problem. Check the back end's ingest errors and rejections before changing Collector memory settings. Changing memory limits to hide a slow back end moves the failure rather than fixing it. Compare these signals over the same time window, and record the Collector's memory use alongside them.
How do bursts differ from sustained overload in a Collector?
A burst is a short spike that a correctly sized Collector absorbs through its queues and batching, then recovers from once traffic falls. Sustained overload is a rate the Collector or its exporters cannot clear over a longer period, so queues stay full and the memory_limiter keeps refusing data. The distinction matters because the fixes differ. Bursts call for queue capacity, sensible batch sizes and container memory headroom. Sustained overload calls for more Collector capacity, scaling out, or a change in what is collected. For illustration, a deploy that doubles log volume for ten minutes is a burst, while a permanent increase in services sending traces is sustained growth that needs a new capacity plan.
How DeployOpen works on this
DeployOpen plans and implements self-hosted OpenTelemetry Collector pipelines inside your own cloud accounts, data centers or air-gapped networks. For memory and batching work, we start from the burst patterns and back-end behavior of your environment, then set memory_limiter thresholds, batch sizes and container limits against observed signals, and document the result for your operations team.
How we scope
- Written scope lists which Collectors, pipelines and signals are included in the memory and batching work.
- We review current memory_limiter and batch settings, container limits and expected telemetry bursts before fixing deliverables.
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Quotes follow from the written scope, so ask which Collectors, environments and load tests are covered.
How we build
- We set memory_limiter thresholds and batch processor sizes in the configuration, placing batching at the points your pipeline needs it.
- We check refused-data and exporter queue signals under simulated bursts in a non-production environment you approve.
- We align container memory limits with the Collector's own limiter settings so the process is throttled before it is killed.
- We keep configuration in version control so each sizing change can be reviewed and rolled back.
How we hand over
- You receive the final configuration, the sizing rationale and the test results for each pipeline.
- Runbooks cover which metrics to watch, such as otelcol_processor_refused_spans and exporter queue capacity and size, and what action each signal calls for.
- We walk your platform and operations engineers through the settings and the reasoning behind them.
- Documentation records which Collector version and distribution the sizing was validated against.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers.
- Retainers can cover re-sizing when traffic grows, new signals are added or the Collector version changes.
- Upgrades to newer Collector releases are checked against existing memory and batching settings before rollout.
- Confirm with DeployOpen the response expectations and support hours in the written agreement before signing.

