The only agent that thinks for itself

Autonomous Monitoring with self-learning AI built-in, operating independently across your entire stack.

Unlimited Metrics & Logs
Machine learning & MCP
5% CPU, 150MB RAM
3GB disk, >1 year retention
800+ integrations, zero config
Dashboards, alerts out of the box
> Discover Netdata Agents

Centralized metrics streaming and storage

Aggregate metrics from multiple agents into centralized Parent nodes for unified monitoring across your infrastructure.

Stream from unlimited agents
Long-term data retention
High availability clustering
Data replication & backup
Scalable architecture
Enterprise-grade security
> Learn about Parents

Fully managed cloud platform

Access your monitoring data from anywhere with our SaaS platform. No infrastructure to manage, automatic updates, and global availability.

Zero infrastructure management
99.9% uptime SLA
Global data centers
Automatic updates & patches
Enterprise SSO & RBAC
SOC2 & ISO certified
> Explore Netdata Cloud

Deploy Netdata Cloud in your infrastructure

Run the full Netdata Cloud platform on-premises for complete data sovereignty and compliance with your security policies.

Complete data sovereignty
Air-gapped deployment
Custom compliance controls
Private network integration
Dedicated support team
Kubernetes & Docker support
> Learn about Cloud On-Premises

Powerful, intuitive monitoring interface

Modern, responsive UI built for real-time troubleshooting with customizable dashboards and advanced visualization capabilities.

Real-time chart updates
Customizable dashboards
Dark & light themes
Advanced filtering & search
Responsive on all devices
Collaboration features
> Explore Netdata UI

Monitor on the go

Native iOS and Android apps bring full monitoring capabilities to your mobile device with real-time alerts and notifications.

iOS & Android apps
Push notifications
Touch-optimized interface
Offline data access
Biometric authentication
Widget support
> Download apps

The future of infrastructure observability

See our strategic direction across AI-native observability, full-stack signals, operational intelligence, and enterprise platform maturity.

AI-native observability
Full-stack signal coverage
Operational intelligence
Enterprise platform maturity
Agent releases every 6 weeks
Cloud continuous delivery
> Explore Product Roadmap

Best energy efficiency

True real-time per-second

100% automated zero config

Centralized observability

Multi-year retention

High availability built-in

Zero maintenance

Always up-to-date

Enterprise security

Complete data control

Air-gap ready

Compliance certified

Millisecond responsiveness

Infinite zoom & pan

Works on any device

Native performance

Instant alerts

Monitor anywhere

AI-native observability

Continuous delivery

Open source foundation

80% Faster Incident Resolution

AI-powered troubleshooting from detection, to root cause and blast radius identification, to reporting.

True Real-Time and Simple, even at Scale

Linearly and infinitely scalable full-stack observability, that can be deployed even mid-crisis.

90% Cost Reduction, Full Fidelity

Instead of centralizing the data, Netdata distributes the code, eliminating pipelines and complexity.

See and Map Your Entire Network

Live topology, flow analytics, and SNMP device and trap monitoring — unified with your full-stack observability.

Control Without Surrender

SOC 2 Type 2 certified with every metric kept on your infrastructure.

Integrations

800+ collectors and notification channels, auto-discovered and ready out of the box.

800+ data collectors
Auto-discovery & zero config
Cloud, infra, app protocols
Notifications out of the box
> Explore integrations
Real Results
46% Cost Reduction

Reduced monitoring costs by 46% while cutting staff overhead by 67%.

— Leonardo Antunez, Codyas

Zero Pipeline

No data shipping. No central storage costs. Query at the edge.

From Our Users
"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

No Query Language

Point-and-click troubleshooting. No PromQL, no LogQL, no learning curve.

Enterprise Ready
67% Less Staff, 46% Cost Cut

Enterprise efficiency without enterprise complexity—real ROI from day one.

— Leonardo Antunez, Codyas

SOC 2 Type 2 Certified

Zero data egress. Only metadata reaches the cloud. Your metrics stay on your infrastructure.

Full Coverage
800+ Collectors

Auto-discovered and configured. No manual setup required.

Any Notification Channel

Slack, PagerDuty, Teams, email, webhooks—all built-in.

Built for the People Who Get Paged

Because 3am alerts deserve instant answers, not hour-long hunts.

Every Industry Has Rules. We Master Them.

See how healthcare, finance, and government teams cut monitoring costs 90% while staying audit-ready.

Monitor Any Technology. Configure Nothing.

Install the agent. It already knows your stack.
From Our Users
"A Rare Unicorn"

Netdata gives more than you invest in it. A rare unicorn that obeys the Pareto rule.

— Eduard Porquet Mateu, TMB Barcelona

99% Downtime Reduction

Reduced website downtime by 99% and cloud bill by 30% using Netdata alerts.

— Falkland Islands Government

Real Savings
30% Cloud Cost Reduction

Optimized resource allocation based on Netdata alerts cut cloud spending by 30%.

— Falkland Islands Government

46% Cost Cut

Reduced monitoring staff by 67% while cutting operational costs by 46%.

— Codyas

Real Coverage
"Plugin for Everything"

Netdata has agent capacity or a plugin for everything, including Windows and Kubernetes.

— Eduard Porquet Mateu, TMB Barcelona

"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

Real Speed
Troubleshooting in 30 Seconds

From 2-3 minutes to 30 seconds—instant visibility into any node issue.

— Matthew Artist, Nodecraft

20% Downtime Reduction

20% less downtime and 40% budget optimization from out-of-the-box monitoring.

— Simon Beginn, LANCOM Systems

Pay per Node. Unlimited Everything Else.

One price per node. Unlimited metrics, logs, users, and retention. No per-GB surprises.

Free tier—forever
No metric limits or caps
Retention you control
Cancel anytime
> See pricing plans

What's Your Monitoring Really Costing You?

Most teams overpay by 40-60%. Let's find out why.

Expose hidden metric charges
Calculate tool consolidation
Customers report 30-67% savings
Results in under 60 seconds
> See what you're really paying

Your Infrastructure Is Unique. Let's Talk.

Because monitoring 10 nodes is different from monitoring 10,000.

On-prem & air-gapped deployment
Volume pricing & agreements
Architecture review for your scale
Compliance & security support
> Start a conversation

Monitoring That Sells Itself

Deploy in minutes. Impress clients in hours. Earn recurring revenue for years.

30-second live demos close deals
Zero config = zero support burden
Competitive margins & deal protection
Response in 48 hours
> Apply to partner

Per-Second Metrics at Homelab Prices

Same engine, same dashboards, same ML. Just priced for tinkerers.

Community: Free forever · 5 nodes · non-commercial
Homelab: $90/yr · unlimited nodes · fair usage
> Get the Homelab Plan

$1,000 Per Referral. Unlimited Referrals.

Your colleagues get 10% off. You get 10% commission. Everyone wins.

10% of subscriptions, up to $1,000 each
Track earnings inside Netdata Cloud
PayPal/Venmo payouts in 3-4 weeks
No caps, no complexity
> Get your referral link
Cost Proof
40% Budget Optimization

"Netdata's significant positive impact" — LANCOM Systems

Calculate Your Savings

Compare vs Datadog, Grafana, Dynatrace

Savings Proof
46% Cost Reduction

"Cut costs by 46%, staff by 67%" — Codyas

30% Cloud Bill Savings

"Reduced cloud bill by 30%" — Falkland Islands Gov

Enterprise Proof
"Better Than Combined Alternatives"

"Better observability with Netdata than combining other tools." — TMB Barcelona

Real Engineers, <24h Response

DPA, SLAs, on-prem, volume pricing

Why Partners Win
Demo Live Infrastructure

One command, 30 seconds, real data—no sandbox needed

Zero Tickets, High Margins

Auto-config + per-node pricing = predictable profit

Homelab Ready
Free Video Course

8-episode Netdata tutorial by LearnLinux.tv

76k+ GitHub Stars

3rd most starred monitoring project

Worth Recommending
Product That Delivers

Customers report 40-67% cost cuts, 99% downtime reduction

Zero Risk to Your Rep

Free tier lets them try before they buy

AI Support Assistant, Available 24/7

Nedi has access to all official documentation, source code, and resources. Ask any question about Netdata—responds in your language.

Deployment & configuration
Troubleshooting & sizing
Alerts & notifications
Evidence-based answers
> Ask Nedi now

Never Fight Fires Alone

Docs, community, and expert help—pick your path to resolution.

Learn.netdata.cloud docs
Discord, Forums, GitHub
Premium support available
> Get answers now

60 Seconds to First Dashboard

One command to install. Zero config. 850+ integrations documented.

Linux, Windows, K8s, Docker
Auto-discovers your stack
> Read our documentation

76,000+ Engineers Strong

615+ contributors. 1.5M daily downloads. One mission: simplify observability.

Per-Second. 90% Cheaper. Data Stays Home.

Side-by-side comparisons: costs, real-time granularity, and data sovereignty for every major tool.

See why teams switch from Datadog, Prometheus, Grafana, and more.

> Browse all comparisons
Edge-Native Observability, Born Open Source
Per-second visibility, ML on every metric, and data that never leaves your infrastructure.
Founded in 2016
615+ contributors worldwide
Remote-first, engineering-driven
Open source first
> Read our story
Promises We Publish—and Prove
12 principles backed by open code, independent validation, and measurable outcomes.
Open source, peer-reviewed
Zero config, instant value
Data sovereignty by design
Aligned pricing, no surprises
> See all 12 principles
Edge-Native, AI-Ready, 100% Open
76k+ stars. Full ML, AI, and automation—GPLv3+, not premium add-ons.
76,000+ GitHub stars
GPLv3+ licensed forever
ML on every metric, included
Zero vendor lock-in
> Explore our open source
Build Real-Time Observability for the World
Remote-first team shipping per-second monitoring with ML on every metric.
Remote-first, fully distributed
Open source (76k+ stars)
Challenging technical problems
Your code on millions of systems
> See open roles
Meet the Team Behind Netdata
Conferences, meetups, and tradeshows where you can see Netdata in action and talk to the engineers who build it.
Live demos and deep dives
Book 1-on-1 meetings
Talks and panel sessions
Event recaps and photos
> See all events
Talk to a Netdata Human in <24 Hours
Sales, partnerships, press, or professional services—real engineers, fast answers.
Discuss your observability needs
Pricing and volume discounts
Partnership opportunities
Media and press inquiries
> Book a conversation
Your Data. Your Rules.
On-prem data, cloud control plane, transparent terms.
Trust & Scale
76,000+ GitHub Stars

One of the most popular open-source monitoring projects

SOC 2 Type 2 Certified

Enterprise-grade security and compliance

Data Sovereignty

Your metrics stay on your infrastructure

Validated
University of Amsterdam

"Most energy-efficient monitoring solution" — ICSOC 2023, peer-reviewed

ADASTEC (Autonomous Driving)

"Doesn't miss alerts—mission-critical trust for safety software"

Community Stats
615+ Contributors

Global community improving monitoring for everyone

1.5M+ Downloads/Day

Trusted by teams worldwide

GPLv3+ Licensed

Free forever, fully open source agent

Why Join?
Remote-First

Work from anywhere, async-friendly culture

Impact at Scale

Your work helps millions of systems

$ guides / haproxy / haproxy-tune-bufsize-large-headers

Operations Guides

HAProxy tune.bufsize and 400 errors: buffers too small for large headers

Your frontend 400 rate just spiked. The backends insist they never saw the requests, and they are telling the truth: HAProxy generated these 400s itself, during header parsing, before any backend was selected. The usual trigger is a request header block that no longer fits in the per-connection buffer, and the usual suspects are large cookies, JWT bearer tokens, or a newly added header that pushed total header size past the limit.

The mechanism: every connection gets two buffers of tune.bufsize bytes each (default 16384), one for the request, one for the response. HAProxy must hold the complete request line plus all headers in the request buffer before it can evaluate ACLs and route. If the request line plus headers exceed the usable buffer space, HAProxy cannot parse the request, so it rejects it with its own 400 Bad Request. The request never reaches a backend.

The trap is the fix. Raising tune.bufsize multiplies per-connection memory: two buffers per connection, times every connection up to maxconn. Double the buffer and you roughly double the memory HAProxy needs at full connection load. Operators who bump bufsize to silence 400s without doing this arithmetic sometimes trade a client-visible error for an OOM kill weeks later.

What this means

The default tune.bufsize is 16384 bytes. Not all of it is usable for headers: tune.maxrewrite (default 1024) is reserved headroom so HAProxy can rewrite or add headers (think X-Forwarded-For) without overflowing the buffer. The effective ceiling for the request line plus headers is approximately tune.bufsize - tune.maxrewrite, roughly 15 KB at defaults.

When a request exceeds that ceiling:

  • HAProxy aborts the request during parsing and returns its own 400. The termination state in the log is PR-- (proxy abort during header parsing), which distinguishes it cleanly from a backend-returned 400.
  • The frontend ereq counter increments.
  • No backend counter moves. req_tot on the backend, per-server hrsp_*, econ, and rtime are all unaffected because the request was never dispatched.

The symmetric case on the response side is a backend whose response headers exceed the buffer. That produces a 502, not a 400, and shows up as eresp on the backend. This article covers the request side; for the response side see HAProxy 502 Bad Gateway.

Two version behaviors matter. On HAProxy 3.1 and later, the mux returns more specific codes instead of a generic 400: 414 (URI Too Long) when the request line itself is too large, and 431 (Request Header Fields Too Large) when the header block overflows. If you upgraded recently and your 400 alerts went quiet while client complaints continued, check whether the errors reclassified into 414/431, which still land in hrsp_4xx. A bug in the early implementation reported incorrect status codes in some cases; it was fixed in 3.2.8. Also note that a custom errorfile 400 will no longer fire for these rejections on 3.1+, because the status is no longer 400.

flowchart LR
  C[Client request] --> P{Headers fit in
bufsize - maxrewrite?} P -- yes --> R[Parse OK, ACLs,
backend selection] R --> B[Backend server] P -- no --> X[HAProxy generates 400
or 414/431 on 3.1+] X --> E[ereq increments,
log shows PR--] B --> N[backend counters,
rtime, hrsp_*]

Common causes

CauseWhat it looks likeFirst thing to check
Large cookies or JWT tokens400 spike after an auth change: new identity provider, larger claims, extra cookie attributesCorrelate the 400 spike timestamp with the auth/cookie rollout
New header added by an upstream hop400s start after a CDN, WAF, or gateway change that injects tracing or metadata headersshow errors on the stats socket to see the rejected request bytes
Long URIsOn 3.1+, 414 instead of 400; ereq increments; URLs with huge query stringsLog line: termination state PR--, captured request target length
Legitimate growth of header setsSlow, steady increase in ereq rate over weeks as features add headersCompare ereq rate trend against deploy history
TLS record edge case at default bufsizeIntermittent 400/500 with PR-- even though headers look small, TLS clients sending full 16K recordsCheck whether only TLS frontends show the errors; see the sizing note under Fixes

Not every PR-- is bufsize. Malformed requests, PROXY protocol misconfiguration, and plaintext-to-TLS mismatches also increment ereq. The distinguishing test is whether the rejected requests are well-formed but large, which is exactly what show errors reveals.

Quick checks

# Check ereq on frontends - this is the counter that moves for buffer overflows
echo "show stat" | socat unix-connect:/var/run/haproxy.sock stdio | \
  awk -F, '$2 == "FRONTEND" {print $1": ereq="$13}'

# Check frontend 4xx (CSV field 43 is hrsp_4xx)
echo "show stat" | socat unix-connect:/var/run/haproxy.sock stdio | \
  awk -F, '$2 == "FRONTEND" {print $1"/"$2": 4xx="$43}'

# Inspect captured error samples - shows the exact bytes that caused rejection
echo "show errors" | socat unix-connect:/var/run/haproxy.sock stdio

# Confirm current buffer configuration in the running config
grep -E 'tune\.(bufsize|maxrewrite)' /etc/haproxy/haproxy.cfg

# Global connection count for the memory arithmetic later
echo "show info" | socat unix-connect:/var/run/haproxy.sock stdio | grep -E "^(CurrConns|Maxconn|PoolFailed):"

All of these are read-only. show errors is the highest-value check: it dumps captured samples of rejected requests, and for a buffer overflow you will see a well-formed request whose header block runs right up to the buffer limit. If instead you see garbled bytes or a TLS ClientHello on a plaintext listener, your problem is a protocol mismatch, not bufsize.

In the logs, grep for the termination state:

# Find proxy-abort terminations during request parsing
grep ' PR-- ' /var/log/haproxy.log | tail -20

The exact log field position depends on your log-format, but PR-- is the signature: the proxy aborted the session while parsing request headers. A backend 400 shows a normal termination state with the 400 status and a server name; a bufsize 400 shows PR-- with no backend server involved.

How to diagnose it

  1. Confirm the 400s are HAProxy-generated, not backend-generated. Compare frontend hrsp_4xx and ereq movement against backend hrsp_4xx. If frontend 4xx rises in lockstep with ereq while backend 4xx is flat, HAProxy is the source. The same frontend-minus-backend logic used for 5xx applies here; see HAProxy 5xx delta for the general technique.

  2. Correlate with a change. A bufsize overflow almost never appears spontaneously on a static system. Look for an auth rollout (larger JWTs, new cookie attributes), a new upstream hop injecting headers, a client release, or a WAF/CDN change.

  3. Capture the offending request with show errors. Confirm the request is well-formed and that the header block is large. Estimate its size: if the headers approach 15 KB, you are at the bufsize - maxrewrite ceiling.

  4. Check the termination state and status code in logs. PR-- confirms the abort happened during header parsing. On 3.1+, expect 414 for oversized request lines and 431 for oversized header blocks; on earlier versions, 400 for both.

  5. Rule out the lookalikes. PROXY protocol mismatch and plaintext-to-TLS mismatch also produce ereq, but those requests fail immediately at the first bytes and affect every request from the misconfigured source, not just large ones. If only requests with big headers fail while small requests from the same clients succeed, it is bufsize.

  6. Quantify the memory cost before fixing. Note CurrConns peak and Maxconn. Each established connection can hold 2 x tune.bufsize of buffer memory, 32 KB at defaults, before connection and stream metadata on top. Compute what your planned bufsize does to that number at full maxconn.

Metrics and signals to monitor

SignalWhy it mattersWarning sign
ereq (frontend)Direct counter for requests HAProxy could not parse, including buffer overflowAny spike, especially correlated with a deploy or auth change
hrsp_4xx (frontend)Captures the 400/414/431 responses clients receiveSpike above 2x baseline; on 3.1+, watch the whole 4xx family, not just 400
Termination state PR-- in logsConfirms the abort happened during request parsing, not at the backendAny occurrence alongside large headers
PoolFailed (show info)Buffer allocation failures under memory pressureMust be zero; nonzero after a bufsize increase means you overshot
PoolUsed_MB / system memoryPer-connection memory scales with bufsizeGrowth after a bufsize change, worse at peak CurrConns
CurrConns / MaxconnConnection count is the multiplier in the memory formulaHigh sustained connections plus a large bufsize equals large committed memory

Fixes

Reduce header size at the source

This is the right fix when the headers grew for accidental reasons: duplicated cookie attributes, an oversized JWT crammed with claims, tracing headers stacked by three proxies in a row. Work with the application or auth team to shrink tokens and prune cookies. Deleting stale cookies server-side (Set-Cookie with an expired date) and moving claims out of the token both reduce header size without touching HAProxy. No memory trade-off, no reload risk.

Raise tune.bufsize (with the memory arithmetic done first)

When large headers are legitimate and unavoidable, raise the buffer in the global section:

global
    tune.bufsize 32768

Rules and caveats:

  • Do the memory math. Memory for connection buffers is approximately 2 x bufsize x maxconn. At maxconn 50000, the default 16 KB buffer means about 1.6 GB of buffer memory at full load. Doubling to 32 KB means about 3.2 GB. The official documentation warns that increasing bufsize can cause the system to run out of memory and recommends decreasing maxconn by the same factor you increase bufsize. Treat that as a hard requirement, not a suggestion.
  • maxrewrite scales with it. tune.maxrewrite is readjusted to half of bufsize if set larger than that. The recommended value is around 1024; the usable header space is bufsize - maxrewrite.
  • Bufsize does nothing for request bodies. Bodies are streamed, not buffered. If you raised bufsize to fix large POST bodies and nothing changed, that is why.
  • TLS edge case. TLS 1.2/1.3 plaintext records can be up to 16384 bytes, and with framing overhead plus maxrewrite, a default 16384 buffer is marginally too small for TLS clients that send full-size records. If you see intermittent PR-- errors on TLS frontends with modest headers, a bufsize of at least 18304 covers this case (this figure accounts for the 16384-byte TLS record plus framing and maxrewrite overhead; verify against your specific HAProxy version and OpenSSL configuration).
  • Reload to apply. tune.bufsize is a global directive and requires a reload (SIGUSR2 or systemctl reload haproxy). Counters reset on reload. Raise the value in small steps and watch memory, not in one jump from 16 KB to 256 KB.

On HAProxy 3.4: consider tiered buffers

HAProxy 3.4 introduced tune.bufsize.large and tune.bufsize.small, letting you keep the default buffer for most traffic while allocating larger buffers only where big header fetches, retries, or body waits need them. This avoids paying the 2 x bufsize x maxconn penalty uniformly across every connection. If you are on 3.4 and header size is a chronic problem, this is the architecturally cleaner answer than inflating the global buffer.

Update error pages and alerting for 3.1+

If you customized errorfile 400, replicate it for 414 and 431 or buffer-overflow clients will get the default page. Update any alert or dashboard that counts 400 specifically: include 414 and 431 so the signal does not silently reclassify away after an upgrade.

Prevention

  • Alert on ereq rate per frontend. Any sustained nonzero rate on an internal frontend, or a spike above noise baseline on a public one, deserves a ticket. Correlate with deploy and config-change events before anything else.
  • Budget header size like you budget payload size. Document a maximum expected header block (request line plus headers) for your applications, and keep it comfortably under bufsize - maxrewrite. When a change adds headers, check the budget.
  • Load-test with real headers. Synthetic tests with minimal headers will never catch this. Replay production-shaped requests, including cookies and auth tokens, in staging.
  • Watch memory after any bufsize change. Track process RSS and PoolUsed_MB through a full traffic peak. Check PoolFailed stays at zero.
  • Pin alerting to the whole 4xx family. On 3.1+, the same failure presents as 414 or 431. Alerts keyed only on 400 will miss it.

How Netdata helps

  • Frontend ereq and hrsp_4xx per second, so a buffer-overflow spike is visible within seconds of the header change that caused it, not after client complaints arrive.
  • Frontend versus backend 4xx/5xx split, which makes it immediately obvious the errors are generated by HAProxy itself and never reached a backend server.
  • Correlation against CurrConns and memory, so you can see what a tune.bufsize increase actually did to per-connection memory at peak load before the OOM killer does it for you.
  • PoolFailed and pool memory tracking, confirming whether buffer allocation is keeping up after a bufsize change.
  • Historical baselines, letting you line the 400 spike up against the deploy, auth, or CDN change that introduced the large headers.
The Netdata solution

HAProxy load balancer monitoring with Netdata

Netdata monitors HAProxy with per-second frontend, backend, and queue metrics plus ML-powered anomaly detection. Correlate maxconn saturation, queue buildup, health-check cascades, 5xx attribution, and file-descriptor exhaustion against the backend and host signals behind them, so you catch the incidents in these runbooks before they page anyone.