Tuning Loki ingestion rate limits

Loki rejects pushes when a tenant or stream exceeds its limits. This guide explains which limits to tune globally or per tenant, how to read rejection reasons, and when to fix senders instead.

On this page

Why Loki rejects logs and when to tune ingestion rate limits

Tune ingestion limits only after you have confirmed that the volume is volume the cluster is meant to absorb. A platform team that starts seeing rate_limited errors or discarded log samples after a period of growth usually has two possibilities: the cluster is sized for less traffic than it now receives, or a sender has changed its behavior, for example by logging more verbosely, adding a high-volume service or emitting far more distinct streams than before. Ingestion limits exist to protect the write path, so raising them is a capacity decision. If the extra data is noise, the cheaper fix is at the source, and the limit should stay where it is until that question is answered.

Loki's ingestion limits bound how much data each tenant can push, so that one sender or tenant cannot exhaust distributors and ingesters for everyone else. When a push exceeds the allowed rate, Loki returns rate_limited to the sender. According to the Loki rate limit documentation, that error is addressed by raising ingestion_rate_mb and ingestion_burst_size_mb. You can set these globally under limits_config, or per tenant through runtime overrides, which lets you raise the limit for one team without changing the default for every tenant. Confirm in your own version's configuration reference that the key names match before you edit them.

Changing these values is only one part of the work. Per-stream limits, maximum line size and the reasons Loki writes into discarded sample metrics each point to different causes and different fixes, and this topic page walks through them in order. Read the discard reasons first, because they tell you which limit is being hit. Then decide whether the change belongs in the global defaults, a tenant override or the sending pipeline. Record the chosen values and the reason for each, so the next growth event starts from a known baseline rather than a series of unexplained increases.

Which ingestion limits control what, and where each is set

Loki applies several ingestion limits at once, and a push can be rejected by any one of them. Each limit protects a different part of the cluster, so the right change depends on which one fired. Check the scope of each limit before you edit it, because a global change affects every tenant.

Ingestion rate and burst size

ingestion_rate_mb sets the sustained volume each tenant may push, and ingestion_burst_size_mb sets how far a short spike may exceed it. Both are set globally in limits_config and can be overridden per tenant in runtime overrides. Before raising them, confirm which tenant is being rejected, since a single noisy sender usually needs a per-tenant change rather than a cluster-wide one.

Rate limits docs

Per-stream rate limits

Per-stream limits cap how fast any single stream can receive data, which protects ingesters from one label set that grows hot. A stream that exceeds its share is rejected even when the tenant as a whole is under its total rate. Check the stream labels in the rejected sample before changing anything, because a stream built from a high-cardinality label often causes the problem.

Maximum line size

max_line_size rejects any single log line larger than the configured size, which protects memory and query performance. Loki recommends not raising it above 256kb for performance reasons. Confirm whether the oversized lines are real application output or a multi-line stack trace or payload dump that a sender should split or trim.

Line truncation as an alternative

max_line_size_truncate lets Loki cut long lines to the size limit instead of rejecting them, so the start of each event is kept. This keeps ingestion flowing when occasional long lines are expected. Test the truncation on sample data first, because the cut-off can remove the part of a message that an alert or investigation needs.

Where each limit is set

Global values belong in the limits_config block of the Loki configuration, and they apply to every tenant that has no override. Per-tenant values belong in the runtime overrides file, which can change without a restart. Keep a record of which tenant holds which override so that a later global change does not silently alter a tenant that was tuned on purpose.

Ingestion limit options and when each fits

This table compares four ways to respond to ingestion rejections: raising global limits, raising per-tenant overrides, enabling line truncation, and fixing the sender. Read each row for the symptom it addresses, how far the change reaches, and what it costs the rest of the cluster. The main takeaway is that limit increases widen what the cluster must absorb, so they should follow a check of the sender.

OptionSymptom it addressesScope and risk to the cluster
Raise global limits in limits_configRate-limited errors from many tenants at once, after confirming the traffic is legitimateApplies to every tenant. Higher ingestion can raise memory, ingester load and storage write volume for all tenants, so confirm current defaults for your Loki version in the docs first.
Raise per-tenant overrides in runtime overridesRate-limited errors from one known tenant with a documented volume increaseLimited to the named tenant, which protects others. Still increases load on shared ingesters, and overrides need to be reviewed as the tenant grows.
Enable max_line_size_truncateRejections caused by a small number of very long lines, such as stack traces or serialized payloadsKeeps the log entry but cuts the line, so content is lost. Long lines are more costly to process, and the docs advise against raising max_line_size above 256kb for performance.
Fix sender batching and labelsRate-limited or stream-limited errors caused by many small pushes, bursty batches or high-cardinality labelsChanges only the sending agent or application, with no cluster-wide effect. Requires access to the sender configuration, and gains depend on how the agent batches and labels events.
Fix sender line contentOversized lines from applications that log full payloads or binary dataReduces volume at the source and keeps retained data useful. Needs developer involvement and a release cycle on the application side.
Read discarded sample reasons firstUnclear cause of rejections across tenants or streamsNo change to the cluster. Identifies which limit is hit so you pick the right row above. Confirm metric names for your Loki version in the monitoring docs.

How a push is checked and where it is rejected

The walk starts with a sender pushing logs to the distributor with the X-Scope-OrgID header that identifies the tenant. The distributor applies the tenant's rate and burst limits, then per-stream and maximum line size checks before data reaches the ingesters. Rejected samples are counted in the discarded samples metrics, which is where you read the reason. Check that metric first, then decide whether the sender or the limit needs to change.

Where a push is accepted or rejected, and where the reason is recorded.

How to diagnose and tune ingestion limits safely

This sequence turns a rate_limited or discarded-sample report into a narrow, verified change, so you raise a limit only after confirming the volume is legitimate and the senders are behaving.

  1. Confirm the rejection reason from discarded sample metrics

    Start by reading Loki's discarded sample metrics in your monitoring system to see which reason is counting up: rate limiting, per-stream limits, line size or another validation error. Each reason points to a different limit, so a rate_limited count and a line-length count need different fixes. Record the reason, the time window and the rate of growth before changing anything. Done when you can name one dominant rejection reason and show that its count rises during the periods when clients report failed pushes.

  2. Identify the tenant and streams responsible

    Break the rejections down by tenant, using the X-Scope-OrgID header that identifies each tenant when authentication is enabled, and then by the label sets that carry the most traffic. Most incidents come from one tenant or from a small group of streams, not from the whole cluster. Confirm which tenant and which stream selectors account for most rejected bytes or lines. Done when you have a short list of tenants and label sets, each with its share of the rejections.

  3. Check senders for label churn, batching and duplicate shipping

    On the responsible senders, inspect the agent configuration and the logs it emits. Look for labels whose values change constantly, such as request IDs, pod names that rotate on every deploy or timestamps placed in labels, because each new value creates a new stream. Check whether the agent sends very small batches, which inflates request counts, and whether two collectors or a retry loop ship the same file twice. Done when you have a written list of sender-side faults, or a confirmed finding that the senders are configured correctly.

  4. Decide whether the volume is legitimate

    Ask the owning team whether the extra volume reflects a real change, such as a new service, a verbose debug setting left on or a planned load test. Estimate the expected daily volume from the application's behavior and compare it with what Loki is receiving. If the volume is a fault, fix the sender and stop here. If it is a genuine, expected increase, continue to the limit change. Done when the owning team has signed off on the volume in writing and you know the expected rate.

  5. Change the narrowest limit first

    If the volume is legitimate, raise only what the evidence requires. Prefer a per-tenant runtime override for ingestion_rate_mb and ingestion_burst_size_mb over a global change in limits_config, so other tenants keep their existing protection. Leave max_line_size at its default unless line length is the rejection reason, and do not raise it above 256kb for performance reasons. For very long lines, consider max_line_size_truncate instead. Record the old and new values, who approved them and the reason. Done when the override is applied and the change is in version control or your change log.

  6. Verify rejections drop without new pressure on ingesters

    After the change, watch the same discarded sample metric for the affected tenant and confirm the rate of rejections falls. At the same time, watch ingester memory, the number of active streams, write latency and distributor errors, because a higher limit lets more data reach ingesters. If pressure rises sharply or new errors appear, roll the override back and address the source of the volume. Done when rejections for the tenant have dropped to near zero and ingester resource use stays within the headroom you measured before the change.

Reading discarded sample metrics to find the real cause

Every rejected push shows up in Loki's discarded samples counter, and its reason label tells you which check fired. A rate reason points at ingestion_rate_mb or ingestion_burst_size_mb, a per-stream reason points at the per-stream limits, a line-length reason points at max_line_size, and the remaining reasons cover other validation such as label count, label length or timestamps outside the accepted window. Before you write alerts or change any limit, confirm the exact metric name and the full set of reason values for your Loki version in the Loki documentation and release notes. Treat that check as the first step, because a limit change made against the wrong reason does nothing useful.

Next, map each reason to a tenant and then to a sender. The counter is normally labeled by tenant, so filter by tenant first and confirm that label name for your version. Stream labels do not identify the machine that produced the data, so join the rejection window with the labels on the affected streams, such as job, namespace, app or the host label your shipper adds, and with the shipper's own logs or metrics for the same period. In most clusters one sender, often a service stuck in a crash loop, a debug log level left on, or a multi-line stack trace split into thousands of lines, accounts for most of the rejections. An illustrative case: one tenant shows 90 percent of its rejections coming from one job label during a single afternoon, which points to that job rather than to the tenant's total volume.

Use what you find to choose the fix. If the noisy sender is producing logs nobody needs, fix it at the source by lowering the log level, correcting the multi-line handling in the shipper or stopping the crash loop, then confirm the rejection counter falls. Raise a limit only when the volume is legitimate, sustained and reviewed by the tenant owner, and then change the global value in limits_config or the tenant's runtime override, as described in the Loki rate limits documentation. Afterwards, watch the same counter for at least one full business cycle to confirm the rejections have stopped and that no other sender has started hitting the new ceiling.

Security and operational risks of loosening ingestion limits

Ingestion limits are a control point for tenant isolation, shared capacity and cost. The cards below cover who may change them, how far a single change reaches, what accepted volume costs over time and how changes are traced afterward.

Operator control of tenant overrides

Per-tenant limits are set in runtime overrides, and whoever can edit that file can change any tenant's ingestion ceiling. Keep the overrides file under operator control in version-controlled configuration, never in a tenant-facing API or dashboard. Tenant identity is taken from the X-Scope-OrgID header, so the proxy must set or strip that header on every request. Before go-live, confirm that no tenant can send an arbitrary tenant ID to reach another tenant's limits or data.

Loki multi-tenancy docs

No built-in authentication

Loki has no authentication layer of its own. Tenant identity is only as trustworthy as the authenticating reverse proxy in front of it, such as nginx, HAProxy, OAuth2 Proxy or Pomerium. If the proxy accepts unauthenticated pushes or forwards a client-supplied tenant header, a raised limit simply gives an unknown sender more room. Test direct access to the Loki port from outside the proxy network and confirm it is refused.

Loki authentication docs

Blast radius on shared ingesters

A global increase to ingestion_rate_mb applies to every tenant, and the extra volume lands on the same distributors and ingesters. One noisy sender can then consume memory and write capacity that other tenants depend on, which shows up as slower pushes and rejected traffic for teams that changed nothing. Prefer a per-tenant override for the sender that needs it, and check ingester memory and push latency before and after any global change.

Storage and cost growth

Accepted volume is stored as compressed chunks and index in object storage, and it is kept until retention is configured. Retention is disabled by default, so a raised limit combined with no retention policy means cost grows without a stop point. Estimate daily accepted volume per tenant, apply retention_enabled with per-tenant or per-stream rules, and ask your storage provider to confirm the cost of the resulting footprint before raising any limit.

Loki retention docs

Audit trail for override changes

A limit change that is never recorded cannot be explained during an incident or a review. Record who changed each runtime override, when, the previous value and the reason, and keep those records in the same change system used for other infrastructure. Review overrides on a schedule so temporary raises do not become permanent, and alert on sudden rises in discarded sample counts after a change.

Sender fixes before limit changes

Many rejections come from senders that emit excess lines, duplicate streams or oversized payloads, and those problems stay after a limit is raised. Review the sender configuration and label set first, because high-cardinality labels multiply stream counts and quietly exceed per-stream limits. Raise a limit only after the sender change is confirmed, so the cluster is not carrying a fault that could have been corrected at the source.

Questions teams ask before tuning Loki limits

Is raising Loki ingestion limits ever the right fix?

Yes, but only after you confirm that the traffic is legitimate and expected. Raising ingestion_rate_mb and ingestion_burst_size_mb globally in limits_config, or per tenant through runtime overrides, is the documented fix for rate_limited errors. The better first step is to check whether a sender is misbehaving. Look for log storms, retry loops, duplicated shipping, or a single service emitting far more lines than its peers. If the volume is real and the cluster has capacity for it, a higher limit is correct. If a sender is at fault, raising the limit only lets the problem consume more ingesters, storage and query capacity. Treat each increase as a capacity decision that needs a written owner and a review date.

How much effort does a Loki limits tuning exercise take?

Effort depends mainly on how many senders push logs, how many tenants share the cluster, and how the cluster is deployed. A single-tenant cluster with a handful of Alloy agents is a short review. A multi-tenant cluster with dozens of teams, several log formats and per-tenant overrides takes longer, because each tenant's discarded-sample history and sender configuration must be reviewed separately. Cluster size matters too, since the same rate that is harmless on a large write path can overwhelm a small one. Ask any provider for a scope that lists which tenants, senders and metrics are covered, and how many change rounds are included. Duration should come from that written scope, not from a general estimate.

What does the client team need to provide for a tuning exercise?

The work needs read access to Loki's operational metrics, especially the discarded sample counters that record why lines were rejected. It also needs the sender configurations for Grafana Alloy, Fluent Bit, Fluentd or any other shipper, plus the Loki limits_config and the runtime overrides file. Someone on the client side must own the runtime overrides and approve changes, because those settings are often managed outside the main Helm values. Access to the application teams who own noisy senders is useful, since many fixes sit in their logging code. Confirm these items with your own team before scoping, and name the owner of each.

Can our own team tune Loki ingestion limits without a partner?

Yes, if your team already operates Loki and has someone who reads Loki's metrics and sender configurations confidently. The core steps are to identify rejected samples by reason, trace each reason to a sender, fix the sender where it is wrong, and only then adjust limits with a documented owner. The harder parts are usually cross-team: getting application teams to change logging code, keeping per-tenant overrides consistent, and proving that a limit change will not push load onto other components. A partner adds the most value when the team lacks time, has no recent Loki operations experience, or needs an independent review before a major change.

What does a DeployOpen engagement cover for Loki limits?

DeployOpen works from a written scope agreed before work starts. For ingestion limits, that scope typically defines which tenants and senders are reviewed, which metrics and configurations are examined, what changes are recommended, and who applies them. Deliverables can include a rejection analysis by reason, sender fixes or guidance for application teams, proposed changes to global and per-tenant limits, and a handover note explaining each setting. DeployOpen plans, implements and documents the work inside your infrastructure. Ongoing review of limits after growth is available as a retainer. Ask for the exact deliverables and change rounds in the quote.

Should we raise max_line_size to stop lines from being rejected?

Usually not, at least not first. Loki's documentation recommends not raising max_line_size above 256kb for performance reasons. If your rejections come from oversized lines, first find out why the lines are so large, such as stack traces, serialized payloads or binary data being logged as text. Fixing the sender or truncating those lines is often the better path. Loki offers max_line_size_truncate for cases where truncation is acceptable. Check with the owners of the affected services whether truncated lines still hold the fields that incident response and audits depend on, before you enable it.

How do we know which per-stream or tenant limit is causing rejections?

Start with Loki's discarded sample metrics, which record rejected lines by tenant and by reason. Each reason points to a different limit or cause, so group the counts before changing anything. A rate-based reason suggests a volume issue on a tenant or a sender. A reason tied to stream limits suggests too many unique label combinations, which usually traces back to labels built from request IDs or other high-cardinality values. A line-size reason points to the sender's output. Match the top reasons to specific senders, then confirm the fix in a test before applying it to production tenants.

When fixing senders beats raising limits

A rate limit error usually reports a symptom, and the cause often sits in the sender. Before raising ingestion_rate_mb or ingestion_burst_size_mb, check what Grafana Alloy is actually pushing. Label churn is the most common culprit: a label whose value changes on every request, such as a request ID, pod revision or timestamp, creates a new stream each time, so the distributor sees a flood of small, short-lived streams instead of steady traffic. Unbatched pushes have a similar effect, because each request carries very little data and the overhead of many small pushes adds up. Duplicate shipping, where two agents or two pipelines read the same files or containers, doubles the volume without adding any useful lines. Oversized lines, such as stack traces or serialized payloads, can hit max_line_size and generate errors that look like throughput problems. Confirm each of these in the sender's configuration and in the ingestion metrics before changing any limit.

A legitimate growth case has a recognizable shape. Volume rises in step with a known change, such as a new service, a traffic increase or a planned logging level change, and the distribution of streams and label values stays stable. A misconfigured sender tends to show sudden spikes, a stream count that climbs without a matching rise in applications, many streams with one line each, or a few tenants or hosts dominating the traffic. For fixes at the source, work with the owner of each Alloy configuration to add batching, remove unbounded values from labels and move them into structured metadata where appropriate, deduplicate collection, and drop or truncate lines that the business does not need. Loki recommends keeping max_line_size at or below 256kb for performance, so truncating with max_line_size_truncate is usually preferable to raising the limit. Promtail reached end of life on March 2, 2026, so if any legacy agents still run it, plan their move to Alloy as part of this work rather than tuning around them.

Track each fix against the discarded samples metrics so you can show whether the change worked. Record the rejected volume and reason before the change, apply one sender fix at a time, and confirm that the rejection rate drops without a new error elsewhere. Keep a short note of every limit that was raised, the evidence behind it and the date, so the next review can tell a deliberate capacity decision from a workaround. If your team cannot confirm the sender's behavior, ask DeployOpen or your internal platform team to review the Alloy configuration and the stream count together before agreeing on a limit change.

How DeployOpen scopes and delivers Loki limit tuning

DeployOpen treats Loki ingestion limits as part of the sending pipeline, not only as a cluster setting. The work starts by finding which senders produce rejections, then changes limits only where the traffic justifies it, inside your own infrastructure.

How we scope

  • Written scope lists the Loki deployment, tenants and senders covered by the limit review
  • Scope names the rejection reasons to investigate, such as rate limiting and oversized lines
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts
  • Ask whether the scope includes sender fixes, limit changes per tenant, or both

How we build

  • Read discarded sample metrics to group rejections by tenant, reason and sending source
  • Trace each rejection cause to a sender configuration, batch size or label pattern
  • Adjust global or per-tenant ingestion rate and burst settings only where the traffic requires them
  • Test changes against representative push load before they reach production tenants

How we hand over

  • Documented baseline of limits, reasons for each change and the senders that were corrected
  • Runbook for reading discarded sample metrics and deciding between a sender fix and a limit change
  • Configuration kept in your version control, reviewed by your platform team before rollout
  • Walkthrough with the operators who will own limit changes after the engagement ends

How we support

  • Retesting after sender or limit changes, so rejections stay understood over time
  • Ongoing support, upgrades and continuous testing are available as retainers
  • Retainer scope is agreed in writing, with the Loki version and senders it covers named
  • Ask for the support model and response expectations in the written quote

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.