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 / cockroachdb / cockroachdb-sql-memory-budget-53200

Operations Guides

CockroachDB error 53200: SQL memory budget exhausted and query rejection

Error 53200 is CockroachDB’s PostgreSQL-compatible signal that the per-node SQL memory budget has run out. Applications see SQLSTATE 53200 (“insufficient resources”) with text such as “memory budget exceeded” and byte counts showing what was requested, what is allocated, and what the budget allows.

The SQL memory budget is enforced per-node, bounded by --max-sql-memory (default 25% of system RAM). When a node’s SQL execution layer exhausts its budget, queries on that node either spill to temporary disk storage (slow) or are rejected outright with 53200. One large analytical query on a single gateway node can starve every other session connected to that node, even if the rest of the cluster has memory to spare.

What this means

The SQL execution memory pool covers sorts, hash joins, window functions, result buffering, and other execution operators. The sql_mem_root_current gauge tracks how much of the budget is currently consumed.

As utilization approaches the limit, two things happen in sequence:

  1. Spill to disk. The SQL engine spills intermediate results (sort buffers, hash tables) to temporary storage on disk. This keeps queries running but causes dramatic latency spikes. A large sort that spills to disk can be 100x slower than its in-memory equivalent.

  2. Query rejection. When the budget is fully exhausted, the node rejects queries that need additional memory with error 53200. The rejection is immediate and visible to the application.

The budget is shared across all sessions on a node with no per-query memory reservation. A single unbounded SELECT ... ORDER BY on a large table can consume the entire budget, causing every other query on that node to spill or fail. This is why 53200 often appears as a burst affecting many sessions simultaneously, even though only one query is the root cause.

flowchart TD
    A["Large query or connection burst"] --> B["sql_mem_root_current climbs"]
    B --> C{"Budget vs --max-sql-memory"}
    C -->|"70-90%"| D["Queries spill to temp storage"]
    D --> E["P99 latency spikes from disk I/O"]
    C -->|"At limit"| F["Queries rejected: error 53200"]
    F --> G["Per-node: all sessions starved"]
    G --> H["Client retries amplify load"]
    H --> B

Rejected queries trigger client retries, which add more load to the same or neighboring nodes, driving memory utilization back up.

Common causes

CauseWhat it looks likeFirst thing to check
Runaway analytical querySingle query fingerprint dominates; sql_mem_root_current spikes on one nodecrdb_internal.node_statement_statistics for the largest consumer
Connection storm after failoversql_conns doubles or triples on surviving nodes; memory rises proportionallysql_conns per node against baseline
Budget too small for workloadsql_mem_root_current consistently above 70%; 53200 at regular intervals--max-sql-memory flag value vs actual workload
Automatic statistics collectionErrors correlate with stats jobs; ANALYZE or CREATE STATISTICS runningcrdb_internal.jobs for stats collection timing
Version-specific accounting bug53200 on simple queries with ample budget; pattern matches known bugCockroachDB version against release notes

Quick checks

Run these read-only checks on the affected node.

# Check current SQL memory utilization against the budget
curl -s http://localhost:8080/_status/vars | grep sql_mem_root_current

# Check SQL error rate (includes 53200)
curl -s http://localhost:8080/_status/vars | grep sql_failure_count

# Check process RSS against available memory
curl -s http://localhost:8080/_status/vars | grep -E 'sys_rss|sys_go_allocbytes|sys_cgo_allocbytes'

# Check Go GC pause accumulation
curl -s http://localhost:8080/_status/vars | grep -E 'sys_gc_pause_ns|sys_gc_count'

# Check active connections and goroutine count
curl -s http://localhost:8080/_status/vars | grep -E 'sql_conns|sys_goroutines'

# Check the configured --max-sql-memory flag
ps -p $(pgrep -x cockroach) -o args= | tr ' ' '\n' | grep max-sql-memory

For SQL-level diagnostics (admin privileges required, table structure is version-sensitive):

-- Find failed statements by frequency
SELECT key, count FROM crdb_internal.node_statement_statistics
WHERE failed = true ORDER BY count DESC LIMIT 20;

-- Check active sessions for long-running queries
SELECT * FROM [SHOW CLUSTER SESSIONS]
WHERE active_queries != '' ORDER BY start DESC;

-- Check per-operator spill threshold
SHOW CLUSTER SETTING sql.distsql.temp_storage.workmem;

How to diagnose it

  1. Identify which nodes are affected. Pull sql_mem_root_current from every node, not just one. One node may be at 95% while others sit at 30%. The node hitting the ceiling is your gateway for expensive queries.

  2. Find the memory-consuming query. Query crdb_internal.node_statement_statistics on the affected node. Look for statements with high row counts or full scan patterns. If active query dumps are enabled (diagnostics.active_query_dumps.enabled, on by default), check the heap_profiler directory for activequeryprof CSV files written during memory pressure events.

  3. Correlate memory with errors. Overlay sql_mem_root_current with sql_failure_count. If errors spike when memory crosses the budget threshold, budget exhaustion is the direct cause. If errors appear before memory is high, look for a different error source.

  4. Check for connection pressure. Compare sql_conns against baseline. A failover or client retry storm can double or triple connections on surviving nodes, with each connection adding memory overhead (goroutine stacks start at 2 KB minimum plus session state).

  5. Assess GC pressure. If sql_mem_root_current is high and sys_gc_pause_ns is accumulating rapidly, the node may be approaching a Memory Pressure -> GC Thrashing -> Raft Liveness Failure cascade. Individual GC pauses approaching 500 ms are a warning sign. Pauses exceeding 1 second risk missing Raft tick intervals and triggering liveness loss.

  6. Check CockroachDB version. Several versions had memory accounting bugs that cause false 53200 errors. Versions before v24.1 had a bug (present since v21.2) where table statistics collection could trigger “no bytes in account to release” errors when the SQL memory budget was close to exhausted; it was fixed in v24.1. Separately, v23.1 fixed a memory leak introduced in v22.2.9 that accumulated when opening many new connections. If you are seeing 53200 on queries that should not be memory-intensive, check the release notes for your version.

Metrics and signals to monitor

SignalWhy it mattersWarning sign
sql_mem_root_currentCurrent SQL memory allocation vs budgetSustained above 70% with upward trend
sql_failure_countCounter tracking SQL errors including 53200Spike correlating with memory pressure
sys_rssTotal process memory (Go heap, CGo, caches)Approaching 80% of available or cgroup limit
sys_gc_pause_nsCumulative GC pause timeIndividual pauses approaching 500 ms to 1 s
sys_go_allocbytesGo heap allocationGrowing faster than GC can reclaim
sql_connsActive pgwire connectionsMore than 2x baseline without workload increase
sys_goroutinesActive goroutines (connections plus overhead)Growing monotonically without workload change

Fixes

Kill the runaway query

If a single query is consuming the budget, cancel it:

CANCEL QUERY '<query_id>';

Find the query ID from SHOW CLUSTER SESSIONS or the DB Console Active Queries page. This is the fastest way to restore service but does not prevent recurrence.

Tune the per-operator spill threshold

The sql.distsql.temp_storage.workmem cluster setting (default 64 MiB) controls how much memory each SQL operator can use before spilling to disk. This is a cluster-wide change that takes effect immediately without restart.

-- Raise per-operator work memory (adjust for your workload)
-- This affects all nodes in the cluster immediately
SET CLUSTER SETTING sql.distsql.temp_storage.workmem = '128MiB';

Raising it lets individual operators hold more data in memory, reducing spills for large sorts and hash joins. The tradeoff: each operator that stays in-memory holds budget that cannot serve other concurrent queries, reducing effective concurrency.

Lowering the value has the opposite effect: more queries spill sooner, but more can run concurrently within the same budget. This is the right lever when you are seeing 53200 from concurrency pressure rather than from a single runaway query.

Increase --max-sql-memory

This requires a node restart. CockroachDB’s memory planning guideline:

(2 * --max-sql-memory) + --cache <= 80% of system RAM

The factor of 2 accounts for temporary memory overcommit during certain SQL execution phases. --max-sql-memory defaults to 25% of system RAM, while --cache defaults to a fixed 128 MiB (256 MiB in recent versions) — the production checklist recommends setting --cache to 25% or higher. In containers, set these explicitly as a fraction of the container memory limit, not the host memory. The CockroachDB Kubernetes Operator sets both to 25% of the pod’s configured memory request/limit by default; keep request and limit equal to your intended budget so the computed values match the container limit.

Do not set --max-sql-memory too aggressively. The Go runtime has allocations (GC metadata, goroutine stacks, internal buffers) not accounted for in the SQL memory monitor. If total memory consumption exceeds available RAM, the process can OOM crash or start swapping, which is worse than rejecting queries.

Note: in systemd unit files, percentage values must be escaped as %% because systemd interprets % in ExecStart directives. Use --max-sql-memory=25%% or specify an absolute value. CockroachDB also accepts decimal notation such as --max-sql-memory=.25 for 25% of system memory.

Fix the query or schema

If the same query repeatedly triggers 53200, the root cause is likely in the query or schema:

  • Missing index causing full table scan with sort. The optimizer scans the entire table, sorts in memory, then returns a small result. Add an index that covers the ORDER BY and WHERE predicates.
  • Hash join on large unindexed tables. The hash table exceeds available budget. Add an index to enable a merge or lookup join instead.
  • Query with LIMIT but no pushdown. A SELECT ... LIMIT n without an index-backed ORDER BY materializes the full result set before truncating. The optimizer cannot push the limit below the sort.

Manage connection storms

If failover-induced connection bursts are the cause:

  • Ensure client libraries use exponential backoff with jitter on reconnect.
  • Deploy PgBouncer in transaction pooling mode in front of CockroachDB to cap direct connections.
  • Monitor sql_conns per node against baseline to catch storms before they trigger memory pressure.

For abandoned sessions holding resources:

CANCEL SESSION '<session_id>';

Prevention

  • Alert on sql_mem_root_current trend, not just threshold. A node at 40% with a steady upward slope over weeks is heading toward 53200. Alert on sustained utilization above 70% with an upward trend before rejection begins.
  • Verify memory planning at deploy time. Use the (2 * --max-sql-memory) + --cache <= 80% formula. Account for Go runtime overhead in the remaining 20%.
  • Set memory flags explicitly in containers. Do not rely on defaults that reference host memory when running in a cgroup-limited container.
  • Watch for automatic statistics collection. Stats jobs can trigger “no bytes in account to release” errors when the budget is already near capacity, particularly on versions before v24.1. If errors correlate with stats collection windows, consider scheduling stats collection during off-peak hours.
  • Track Go GC behavior alongside SQL memory. The Memory Pressure -> GC Thrashing -> Raft Liveness Failure cascade starts with memory growth and ends with node liveness loss. GC CPU above 15% or individual pauses above 500 ms are leading indicators.
  • Keep CockroachDB current. Multiple memory accounting bugs have been fixed across versions.

How Netdata helps

  • Per-second sql_mem_root_current tracking catches burst patterns that 15- or 30-second scrape intervals miss entirely, which matters because a single runaway query can exhaust the budget in seconds.
  • Correlation between sql_mem_root_current, sql_failure_count, and sql_service_latency in a single view reveals the exact moment budget exhaustion translates into query rejection and latency spikes.
  • Go runtime signals (sys_gc_pause_ns, sys_go_allocbytes, sys_rss) alongside SQL memory metrics distinguish SQL budget exhaustion from broader process memory pressure and catch the GC thrashing cascade before it threatens node liveness.
  • ML-based anomaly detection on memory utilization trends flags the slow upward drift toward budget exhaustion days before it becomes an incident.

For details, see database monitoring with Netdata.

The Netdata solution

CockroachDB monitoring with Netdata

Netdata monitors CockroachDB with per-second metrics and automatic dashboards. Watch LSM compaction, Raft liveness, clock skew, hot ranges, and intent buildup so the distributed-systems failure modes in these runbooks surface early.