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 / clickhouse / clickhouse-memory-pressure-death-spiral

Operations Guides

ClickHouse memory pressure death spiral: runaway queries, retries, and OOM

MEMORY_LIMIT_EXCEEDED errors climb in the query log. Queries that normally finish in seconds now take minutes or are killed outright. The ClickHouse process is near its memory limit, but killing the heaviest query only frees capacity for a moment before another query is killed. If the application retries immediately, pressure never drops. With spill-to-disk enabled, the bottleneck shifts to disk I/O, starving background merges and slowing the whole system.

This is the memory pressure death spiral: a composite failure pattern where memory saturation triggers query termination or spill-to-disk, rising latency provokes retries, and repeated attempts keep memory pinned near the limit. The spiral ends with an OS-level OOM kill if internal tracker and cgroup limits are misaligned, or with a merge crisis if temporary disk files consume all I/O bandwidth.

What this means

ClickHouse enforces memory limits hierarchically: per-query (max_memory_usage), per-user (max_memory_usage_for_user), and server-wide (max_server_memory_usage). When any tracker hits its limit, ClickHouse kills the offending query with exception code 241. The server-wide cap defaults through max_server_memory_usage_to_ram_ratio = 0.9; on Linux it can also adapt to host or cgroup available memory. Per-query limits live in user profiles; if unset, a query allocates without an individual bound.

Once memory pressure begins, three effects compound:

  1. Query kills do not free headroom. Surviving queries, cache restoration, or background merges immediately reclaim the freed memory.
  2. Retries amplify load. An application that reissues a killed query immediately sends fresh allocations into the same constrained pool.
  3. Spill-to-disk shifts the bottleneck. If spill-to-disk is enabled, queries write temporary files instead of failing. This turns memory pressure into disk I/O pressure that competes with merges and increases latency.

The result is a feedback loop: pressure causes slowdowns and kills, which trigger retries, which restore pressure. Breaking the loop requires identifying whether the root cause is a single runaway query, unbounded concurrency, or an application retry storm.

flowchart TD
    A[Workload surge or runaway query] --> B[Memory allocations rise]
    B --> C{Near max_server_memory_usage?}
    C -->|Yes| D[Queries killed or spilled to disk]
    D --> E[Query latency increases]
    E --> F[Application retries]
    F --> B
    D --> G[Disk I/O saturation]
    G --> H[Merge throughput drops]
    H --> I[Part count rises]
    I --> J[Further latency increase]
    J --> E

Common causes

CauseWhat it looks likeFirst thing to check
Runaway queryA single query shows peak_memory_usage orders of magnitude above the norm in system.processesSELECT query_id, memory_usage, peak_memory_usage, query FROM system.processes ORDER BY memory_usage DESC LIMIT 5
Retry amplificationThe same query pattern appears repeatedly in system.query_log with exception_code = 241SELECT exception_code, count(), any(exception) FROM system.query_log WHERE type = 'ExceptionWhileProcessing' AND event_time > now() - INTERVAL 10 MINUTE GROUP BY exception_code
Unbounded concurrent analyticsTotal memory across all running queries approaches 70% of the server limit with no single dominant querySELECT formatReadableSize(sum(memory_usage)) FROM system.processes
Cache over-allocationMemoryTracking is high despite low query concurrency; mark cache or uncompressed cache consume most RAMSELECT metric, value FROM system.metrics WHERE metric IN ('MarkCacheBytes', 'UncompressedCacheBytes')
Spill-to-disk without I/O headroom/var/lib/clickhouse/tmp/ grows and disk I/O latency spikes while queries continue rather than faills -lah /var/lib/clickhouse/tmp/ and iostat -xz 1 5
Background merge memory spikesMemory pressure coincides with long-running merges in system.mergesSELECT database, table, elapsed, formatReadableSize(memory_usage) FROM system.merges ORDER BY memory_usage DESC

Quick checks

# Check ClickHouse tracked memory vs configured server limit
clickhouse-client -q "SELECT formatReadableSize(value) AS memory_tracking FROM system.metrics WHERE metric = 'MemoryTracking'"

# Check OS RSS and peak to spot divergence from tracked memory
cat /proc/$(pgrep clickhouse-server)/status | grep -E '^(VmRSS|VmPeak|VmSize)'

# Top memory-consuming queries right now
clickhouse-client -q "SELECT query_id, formatReadableSize(memory_usage) AS mem, formatReadableSize(peak_memory_usage) AS peak, substring(query, 1, 120) AS q FROM system.processes WHERE memory_usage > 0 ORDER BY memory_usage DESC LIMIT 10"

# Recent MEMORY_LIMIT_EXCEEDED errors
clickhouse-client -q "SELECT query_id, exception_code, substring(query, 1, 120) AS q FROM system.query_log WHERE type = 'ExceptionWhileProcessing' AND exception_code = 241 AND event_time > now() - INTERVAL 10 MINUTE LIMIT 10"

# Check for spill-to-disk activity in tmp
ls -lah /var/lib/clickhouse/tmp/

# Check concurrent query count and total query memory
clickhouse-client -q "SELECT count() AS queries, formatReadableSize(sum(memory_usage)) AS total_query_mem FROM system.processes"

# Check mark cache size
clickhouse-client -q "SELECT metric, formatReadableSize(value) FROM system.metrics WHERE metric = 'MarkCacheBytes'"

# Check swap usage (swap thrashing makes recovery nearly impossible)
free -h | grep -i swap

How to diagnose it

  1. Confirm server-wide pressure. Compare MemoryTracking from system.metrics to max_server_memory_usage. If the ratio is sustained above 80%, the server is in the danger zone. Also check MemoryResident in system.asynchronous_metrics because RSS can exceed tracked memory due to allocator overhead and untracked allocations.
  2. Identify the memory consumer category. Run the system.processes query sorted by memory_usage. If one query dominates, it is a runaway query. If many moderate queries sum to most of the limit, it is a concurrency problem.
  3. Check for retry amplification. Query system.query_log for exception code 241 over the last 10 minutes. If the same query fingerprint appears multiple times with short intervals, the application is retrying immediately.
  4. Check spill-to-disk activity. Inspect /var/lib/clickhouse/tmp/. Growing files there mean queries are spilling. Correlate with disk I/O metrics (iostat or your infrastructure monitoring). High I/O wait during memory pressure confirms the bottleneck has shifted to disk.
  5. Correlate with merge health. Check system.merges. If merges are running but disk I/O is saturated, merge throughput drops and parts begin to accumulate. This is the secondary death spiral.
  6. Check OS and cgroup limits. In containerized deployments, verify that the cgroup memory limit is not close to ClickHouse’s internal limit. If the container limit is lower than or equal to max_server_memory_usage, the OS OOM killer can fire before ClickHouse’s circuit breaker engages.

Metrics and signals to monitor

SignalWhy it mattersWarning sign
MemoryTracking / max_server_memory_usageMeasures proximity to ClickHouse’s internal query-kill thresholdSustained ratio > 80%
Peak per-query memoryIdentifies runaway queries before they consume the serverSingle query > 50% of server limit
FailedQuery rate with exception 241Direct evidence of the kill-and-retry loopAny sustained increase over baseline
Mark cache hit rateMemory pressure evicts caches, causing more disk I/O< 80% during pressure events (from system.events MarkCacheHits and MarkCacheMisses)
Disk I/O awaitSpill-to-disk and cache misses shift saturation to I/O> 20 ms on SSD sustained
Active merge count and throughputI/O competition from spills starves merges, causing part accumulationMerge throughput flat or falling while parts grow
OSMemoryAvailableThe OS OOM killer operates independently of ClickHouse trackers< 5% of total RAM
Concurrent query countHeavy concurrency compounds moderate per-query memory into server pressureApproaching max_concurrent_queries or 2x typical peak

Fixes

Kill the runaway query and bound per-query memory

Warning: Killing a query is disruptive. The client receives an error and may retry immediately, so coordinate with the application owner before killing production traffic.

Identify the top consumer in system.processes and kill it:

KILL QUERY WHERE query_id = '<query_id>';

Set max_memory_usage in the user profile to prevent recurrence. A sensible starting point is 10-20% of max_server_memory_usage for ad-hoc users, lower for service accounts. The tradeoff is that legitimate large queries fail instead of completing slowly.

Stop retry amplification

Implement exponential back-off and circuit-breaking at the application layer. A query that failed with code 241 should wait seconds, not milliseconds, before retrying, and should give up after a small number of attempts. The tradeoff is temporary query unavailability, but this prevents the retry loop from pinning the server at 100% memory.

Reduce or remove spill-to-disk pressure

If max_bytes_before_external_group_by or max_bytes_before_external_sort are configured and disk I/O is saturated, you have two choices. Raise the thresholds so fewer queries spill, accepting that more will hit code 241. Or leave them enabled but ensure disk I/O capacity is reserved for merges so spills do not compete on the same device. The tradeoff is between query failure and I/O saturation.

Temporarily lower concurrency

If the root cause is a surge of legitimate concurrent heavy queries, reduce max_concurrent_queries temporarily. This queues or rejects new queries until memory drops. The tradeoff is that some client requests fail or wait.

Reclaim memory from caches

If MarkCacheBytes or UncompressedCacheBytes in system.metrics are consuming most RAM, reduce mark_cache_size or the uncompressed-cache size/disable that cache. This frees memory for query working sets at the cost of more disk seeks and decompression on repeated queries.

Align container and ClickHouse limits

In Kubernetes or containerized deployments, ensure the cgroup memory limit leaves headroom above max_server_memory_usage. This prevents the OS OOM killer from terminating the process before ClickHouse can kill the offending query. If the container limit is too tight, lower the configured server-wide limit to leave that headroom.

Prevention

  • Set per-query memory limits for every non-admin user profile. An unbounded query can trigger server-wide pressure.
  • Monitor both MemoryTracking and OS RSS. Alert on divergence because tracked memory underestimates actual footprint.
  • Instrument application retry logic with back-off and jitter. Immediate retries on 241 are an anti-pattern.
  • Size caches conservatively. Leave RAM for query working memory and background merges.
  • Validate spill-to-disk thresholds against I/O capacity before enabling. Spilling is only a safety valve if the disk subsystem can absorb the extra load without starving merges.
  • Review queries that use GLOBAL IN or large JOINs. These can cause unbounded memory growth during aggregation.

How Netdata helps

Netdata correlates ClickHouse MemoryTracking with OS RSS and cgroup memory limits in one chart, surfacing tracker divergence immediately.

Netdata alerts on spikes in exception code 241 and sustained memory saturation without requiring manual system.query_log polling.

Netdata disk I/O latency charts, shown alongside query latency, make it easy to see when spill-to-disk shifts the bottleneck from memory to I/O.

Netdata collects per-query memory from system.processes continuously, so runaway queries are visible before they dominate the server.

Netdata merge pool and active part count charts detect secondary merge starvation caused by I/O competition.

The Netdata solution

ClickHouse monitoring with Netdata

Netdata monitors ClickHouse with per-second metrics and ML anomaly detection. Track merge debt, memory usage, replication lag, Keeper/ZooKeeper saturation, and disk headroom against the host signals that drive them.