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 / apache-httpd / apache-httpd-502-bad-gateway ▌

Operations Guides

Apache 502 Bad Gateway: a backend that returned an invalid response

You are seeing 502 Bad Gateway responses from Apache, usually in bursts, often on some requests and not others. Users report intermittent failures. Apache is running, the port is open, static content may even work. The proxied application path is the thing failing.

A 502 from Apache is almost never an Apache bug. In a mod_proxy deployment, 502 means Apache acted as a reverse proxy, forwarded the request to a backend, and got back something it could not use: a garbled response, an empty response, a connection closed mid-reply, or a connection that refused to carry the request at all. Apache is surfacing a backend signal.

Your job is to find out which backend, which failure mode, and whether it is crashing, overloaded, or misconfigured. The first move is always the same: bypass Apache and talk to the backend directly.

What this means

When Apache proxies a request, it opens (or reuses) a connection to the backend, sends the request, and waits for a valid HTTP response. A 502 is returned when that exchange fails in a way that is not a clean timeout and not a pool exhaustion:

  • The backend accepted the connection but sent an invalid or unparsable status line, or closed the connection before sending one. Error log: AH01102: error reading status line from remote server.
  • The backend started responding and then the read failed partway through (crash mid-response, connection reset). Error log: AH00898: Error reading from remote server.
  • The proxy could not connect or dispatch the request at all. Error log: AH01114: HTTP: failed to make connection to backend (HTTP backends), or AH01075: Error dispatching request to (FastCGI/AJP) paired with a connect error such as (111)Connection refused. These produce 503, not 502; grep for them when triaging mixed 5xx bursts.

Three error codes worth memorizing:

CodeMeaning
AH01102Backend’s status line could not be read or parsed (empty reply, garbled bytes, premature close)
AH00898Generic read failure from the backend, frequently logged alongside AH01102
AH01075FastCGI/AJP dispatch failure (connect refused, DNS failure, pool problem); these requests return 503, not 502

Do not confuse 502 with its neighbors. The distinction determines where you look:

StatusMeaningWhere the problem lives
502Backend returned an invalid response or dropped the exchangeBackend correctness: crash, protocol error, premature close
503Worker pool or proxy pool exhausted, backend marked down in the balancer, or backend refused/dispatch failedCapacity or connectivity: MaxRequestWorkers, proxy pool sizing, balancer state, backend unreachable
504Backend connected but did not respond within ProxyTimeout (default 60s)Backend latency: slow but alive

If you are seeing 503s instead of 502s, this is the wrong article. See Apache 503 Service Unavailable: worker exhaustion versus proxy pool exhaustion.

Common causes

CauseWhat it looks likeFirst thing to check
Backend process crashed or is restarting502s cluster around deploys or restarts; AH01102 with “End of file found” or empty replyBackend process uptime and crash logs
Backend closed connection mid-responseAH00898 paired with AH01102; intermittent, often under loadBackend error logs at the exact timestamps from Apache’s error log
Backend listening socket refused the connectionProduces 503, not 502: AH01114 (HTTP backend) or AH01075 with (111)Connection refused (FastCGI/AJP); 100% failure rate on that pathss -ltn on the backend host for the expected port
Backend sent a syntactically invalid responseAH01102 on every request to one endpoint; backend may be speaking the wrong protocol (plain TCP service behind an HTTP proxy, or HTTPS backend proxied as HTTP)curl -v the backend directly and inspect the raw response
Backend sent invalid response headersHeader lines with no colon produce 502 via ProxyBadHeader; invalid characters in a header name log AH02429: Response header name '<name>' contains invalid characters and produce 500, not 502Reproduce with curl and inspect the raw header block
Keepalive race between Apache and backendSporadic 502s on reused connections; backend’s keepalive timeout shorter than Apache’sWhether failures correlate with idle periods before the request
SELinux or firewall blocking Apache-to-backend trafficAH01075 with permission or connect errors; backend healthy when curled from the Apache host as root but not via ApacheAudit log denials; curl from the Apache host as an unprivileged user

One pattern that does not belong here: all workers stuck waiting on a slow-but-alive backend. That produces 504s first, then 503s as the worker pool drains, not 502s. That is the slow backend cascade; the signals and response differ.

Quick checks

These are all read-only and safe to run during an incident.

# 1. Confirm the 502s and their rate (assumes combined log format, status in field 9)
tail -5000 /var/log/apache2/access.log | awk '$9 == 502 {c++} END {print c+0, "502s in last 5000 requests"}'

# 2. See which proxied paths are failing
tail -5000 /var/log/apache2/access.log | awk '$9 == 502 {print $7}' | sort | uniq -c | sort -rn | head

# 3. Pull the actual proxy error lines
grep -E "AH01102|AH00898|AH01075|AH01114" /var/log/apache2/error.log | tail -20

# 4. Bypass Apache: hit the backend directly (adjust host/port/path)
curl -sv --max-time 10 http://backend-host:8080/the/failing/path -o /dev/null

# 5. From the Apache host: count live backend connections and probe backend health
ss -tn state established dport = :8080 | wc -l
curl -s -o /dev/null -w "connect: %{time_connect}s ttfb: %{time_starttransfer}s code: %{http_code}\n" \
  --max-time 10 http://backend-host:8080/health

# 6. Check Apache's own saturation state (rules out a worker-exhaustion disguise)
curl -s http://localhost/server-status?auto | grep -E "BusyWorkers|IdleWorkers"

# 7. Confirm Apache uptime so you can correlate 502 bursts with restarts or deploys
curl -s http://localhost/server-status?auto | grep ServerUptimeSeconds

Adjust log paths for your distribution (/var/log/httpd/ on RHEL-family systems). Check 4 is the important one. Everything before it tells you that 502s are happening; check 4 starts telling you why.

How to diagnose it

Work through these in order. Each step narrows the fault domain.

  1. Scope the failures. From check 2 above: is it every proxied path, one path, one vhost, one backend in a balancer? A single failing path points at the application behind that path. All paths failing points at the backend process, the network hop, or the proxy configuration.

  2. Read the error log at the failure timestamps. Match access-log 502 lines to error-log entries by timestamp. The AH code tells you the failure class: AH01075/AH01114 means the request never got dispatched (connectivity; those requests return 503, not 502), AH01102 means it was dispatched but the reply was unreadable (backend behavior), AH00898 means the reply started and then broke.

  3. Bypass Apache. From the Apache host, curl the backend directly on the failing path. Three outcomes:

    • Backend fails the same way: Apache is innocent. Debug the backend.
    • Backend responds but with something odd (empty body, non-HTTP bytes, giant headers): you have found the invalid response. Capture it with curl -sv and inspect the raw exchange.
    • Backend responds cleanly and fast: the failure is in the Apache-to-backend path. Suspect keepalive races, connection reuse, proxy pool state, or an intermediary (SELinux, firewall, conntrack).
  4. Correlate with backend lifecycle events. Overlay 502 bursts with deploy times, backend restarts, and backend crash logs. 502s that cluster tightly around restarts are usually the backend closing connections mid-request during shutdown, not a capacity problem.

  5. Check Apache’s own saturation. Confirm BusyWorkers/IdleWorkers from check 6. If IdleWorkers is zero and you also see AH00484: server reached MaxRequestWorkers setting in the error log, worker exhaustion is compounding the backend problem: each failed or retried request still holds a worker. The 502 is the symptom; the backend failure plus worker pile-up is the incident.

  6. If the backend is in a balancer, check member state. If balancer-manager is enabled, look at whether the member is marked errored or disabled. A member flapping between ok and error produces intermittent 502s that look random from the outside.

flowchart TD
  A[502/503 in access log] --> B{Error log code?}
  B -->|AH01075 / AH01114| C[Connectivity: backend down, refused, or blocked]
  B -->|AH01102 / AH00898| D[curl backend directly]
  D -->|Fails the same| E[Backend crash or protocol error]
  D -->|Responds cleanly| F[Proxy path: keepalive race, pool state, SELinux]
  C --> G[Check backend listener and firewall]
  E --> H[Check backend logs and restarts]
  F --> I[Fix reuse and pool config]

Metrics and signals to monitor

SignalWhy it mattersWarning sign
502 rate (access log)Direct measure of the symptomAny sustained rate above zero on a proxied path
502/503/504 ratioTells you which failure class you are in502 dominant = invalid responses; 504 dominant = slow backend; 503 = saturation
AH01102/AH00898/AH01075 lines in error logThe failure class per eventAny occurrence is actionable; bursts indicate a backend event
Backend response time (direct probe)Separates “backend slow” from “backend broken”TTFB climbing toward ProxyTimeout (default 60s)
BusyWorkers / IdleWorkersShows whether failing requests are draining the worker poolIdleWorkers at zero during a 502 burst
Scoreboard W state countWorkers waiting on backends show as WW states climbing while request completion rate falls
Backend process uptimeCorrelates 502 bursts with crashes/restartsUptime resetting in step with 502 bursts

Fixes

Backend crashing or restarting mid-request

Fix the crash, not Apache. If 502s coincide with deploys, the deploy process is dropping in-flight requests: add connection draining to the backend’s shutdown so it finishes active requests before closing listeners. During an active incident, taking the failing backend out of the balancer (or taking the Apache node out of LB rotation) stops user-facing errors while you fix the root cause.

Backend reachable but response invalid

If the direct curl shows a non-HTTP or malformed response, the usual culprits are a protocol mismatch (Apache proxying plain HTTP to a port that speaks HTTPS, or vice versa) or the backend emitting oversized or malformed headers. Fix the protocol scheme in the ProxyPass target, or fix the backend’s header generation. If a backend legitimately sends headers Apache rejects, that is a backend bug to fix, not something to paper over in Apache. Apache’s ProxyBadHeader directive controls how invalid backend header lines (lines with no colon) are handled: IsError (the default) aborts the request with 502, Ignore drops the bad lines, and StartBody treats the first bad line as the start of the body. The default IsError behavior is what produces your 502s.

Keepalive races on reused backend connections

If the backend’s connection idle timeout is shorter than the time Apache holds pooled connections, Apache can send a request on a connection the backend has just closed, producing an empty-reply AH01102. Align the timeouts: the backend should hold idle connections longer than Apache’s proxy pool does. As a diagnostic, disabling keepalive to the backend (for example with SetEnv proxy-nokeepalive 1) should make the sporadic 502s stop, at the cost of a new TCP connection per request. Treat that as confirmation of the race, then fix the timeout alignment rather than leaving keepalive off permanently.

Connection refused (AH01075)

The backend is not listening, is listening on a different port, is bound to a different interface than Apache is reaching, or something in between (SELinux, firewall, security group) is blocking the connect. ss -ltn on the backend host and a direct curl from the Apache host as an unprivileged user resolve which of these it is. On SELinux-enforcing systems, check the audit log for denials against httpd making outbound connections.

Worker pool draining as a side effect

If the 502 burst has also exhausted workers, fix the backend first. Raising MaxRequestWorkers only gives the failing backend more workers to consume. If you must stop the bleeding before the backend is fixed, temporarily lowering ProxyTimeout makes Apache fail faster and release workers sooner, trading longer hangs for quicker 502/504s. That is a mitigation, not a fix.

Prevention

  • Monitor the 5xx classes separately. 502, 503, and 504 have different root causes and different owners. One aggregated 5xx alert hides the distinction that drives diagnosis.
  • Watch the error log for the AH proxy codes. AH01102, AH00898, AH01075, and AH01114 are early, specific signals that appear before user reports do.
  • Probe backends directly, not only through Apache. A synthetic check that bypasses Apache tells you whether the backend is healthy before Apache’s proxy errors confirm it is not. Teams that do not monitor backend health separately from Apache health waste hours debugging the wrong process.
  • Drain connections on backend shutdown. Most 502 bursts in healthy environments trace to deploys and restarts that kill in-flight requests.
  • Alert on worker saturation as a compounding signal. A 502 burst plus IdleWorkers at zero plus listen backlog growth is a different incident than a 502 burst alone. Correlate them in one alert path.
  • Size the proxy pool deliberately. Default proxy pool sizes are small and per-child-process. Pool exhaustion is a 503 problem, but a starved pool under a flapping backend produces mixed 502/503 pictures that are harder to read.

How Netdata helps

  • Netdata’s Apache collector scrapes mod_status every second, so BusyWorkers, IdleWorkers, requests per second, and scoreboard state distribution are captured at the granularity where 502 bursts actually happen, not at 60-second polling intervals that average them away.
  • Per-second worker utilization next to your 5xx rate lets you answer the key question immediately: are 502s coming with worker exhaustion (compounding cascade) or without it (pure backend failure)?
  • Scoreboard state charts show workers accumulating in W state waiting on backends, which distinguishes “backend slow” from “backend broken” before you open a single log file.
  • Netdata’s ML anomaly detection flags deviations in request rate and worker utilization per server, catching the intermittent, low-rate 502 patterns that static thresholds miss.
  • Correlating Apache metrics with the backend service’s own metrics on one dashboard shortens the bypass-Apache diagnostic step from a manual curl exercise to a glance.

Apache HTTP Server monitoring with Netdata brings these signals together with per-second metrics and ML anomaly detection.

The Netdata solution

Apache HTTP Server monitoring with Netdata

Netdata monitors Apache HTTP Server with per-second metrics from mod_status, pre-built dashboards, and ML-powered anomaly detection. Watch busy versus idle workers and the scoreboard state mix, requests per second, bytes served per second, and request processing duration alongside the rest of your stack, so you catch the worker-exhaustion, slow-backend, and memory incidents in these runbooks before they page anyone.