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 / mongodb / mongodb-oplog-window-collapse

Operations Guides

MongoDB oplog window collapse: secondaries falling off and forced full resync

A secondary transitions to RECOVERING and logs “too stale to catch up.” The oplog window compresses from 48 hours to 90 minutes while replication lag on one secondary climbs steadily. These are the signatures of oplog window collapse: a write surge turns over the oplog faster than secondaries can consume it, and the safety margin between window and lag evaporates.

Once a secondary falls behind the oldest entry in the primary’s oplog, its sync position no longer exists. Recovery requires a full initial sync, which can take hours to days depending on data size and network throughput. During recovery, the replica set runs with reduced redundancy. If another secondary is near the edge, the remaining members absorb increased read load that can push them toward the same fate.

This guide covers diagnosis, emergency mitigations, and prevention.

What this means

The oplog is a capped collection (local.oplog.rs) with a fixed maximum size. The oplog window is the time span between its oldest and newest entries. Higher write volume means entries accumulate faster, so the window shrinks.

Secondaries tail the primary’s oplog and apply entries. Replication lag is the time delta between the primary’s latest entry and the secondary’s last applied entry. As long as lag remains smaller than the oplog window, a secondary can catch up after a transient slowdown. Once lag exceeds the window, the secondary’s position has been overwritten. It enters RECOVERING and cannot serve reads or resume replication. It must be rebuilt with a full initial sync.

The critical metric is time-to-falloff: oplog_window - replication_lag. When this drops below your ability to respond, you are one network blip away from losing a member.

flowchart TD
    A[Write surge on primary] --> B[Oplog turns over faster]
    B --> C[Oplog window shrinks]
    C --> D[Secondary replication lag grows]
    D --> E{Window minus lag near zero?}
    E -->|Yes| F[Secondary enters RECOVERING]
    F --> G[Forced full initial sync]
    E -->|No| H[Cluster remains at risk]
    H --> I[Remaining nodes absorb more load]
    I --> J[Cascade risk increases]

Common causes

CauseWhat it looks likeFirst thing to check
Bulk import or migrationPrimary opcounters spike uniformly; oplog window drops sharply across all secondariesdb.serverStatus().opcounters delta on the primary
Large multi-document transactionsDisproportionate oplog consumption relative to operation count; single large entriesdb.currentOp() for transactions open longer than 60 seconds
Secondary apply bottleneckOne secondary lags while others keep up; its disk or CPU is saturateddb.serverStatus().metrics.repl.apply on the lagging secondary
Chained replication topologyRemote secondaries fall off simultaneously even when the cluster holds needed entriesrs.status().members[].syncSource and lag relative to primary

Quick checks

Run these read-only commands to assess state.

# Oplog window, configured size, and time coverage
rs.printReplicationInfo()
# Per-secondary lag and last synced position
rs.printSecondaryReplicationInfo()
# Primary write volume; compute delta between two samples
db.serverStatus().opcounters
# On a lagging secondary, check apply throughput
db.serverStatus().metrics.repl.apply
# Whether flow control is throttling writes
db.serverStatus().flowControl
# Long-running transactions or bulk writes
db.currentOp({ "active": true, "secs_running": { "$gt": 10 } })

How to diagnose it

  1. Quantify the runway. Run rs.printReplicationInfo() to get the oplog window. Run rs.printSecondaryReplicationInfo() to get per-secondary lag. Compute time-to-falloff = window - lag for each secondary. If this is under one hour, treat it as an imminent PAGE.
  2. Confirm the trend is sustained. Brief lag spikes during batch jobs are normal and self-resolve. Look for a sustained downward trend in window size or sustained upward trend in lag over 10 minutes or more.
  3. Compare apply rate to write rate. On the primary, approximate write rate from the sum of insert, update, and delete in opcounters. On the secondary, derive db.serverStatus().metrics.repl.apply.ops delta. If secondary apply rate is consistently below 80% of the primary write rate, the gap will widen until falloff. Network saturation between nodes can also limit fetch throughput.
  4. Identify the write source. Use db.currentOp() to find bulk inserts, large aggregations with $out, index builds, or multi-document transactions. These generate large oplog entries or heavy secondary apply load. Large transactions serialize apply operations on secondaries, reducing concurrency.
  5. Inspect replication topology. If secondaries sync through an intermediate node, a lagging chain member can starve downstream nodes during sync source re-evaluation. Check rs.status() for syncSource values. If a secondary is chained and the intermediate node is lagging, downstream secondaries may fall off despite the primary holding the needed entries. Repeated syncSource changes in the logs indicate the secondary is hunting for a viable source.
  6. Check flow control status. In MongoDB 4.2+, db.serverStatus().flowControl.isLagged indicates the primary is throttling writes to protect secondaries. Active flow control means you are already in a degraded state where write throughput is artificially limited.

Metrics and signals to monitor

SignalWhy it mattersWarning sign
Oplog windowDetermines how long a secondary can be down before it must resync< 12 hours (TICKET); < 2 hours (PAGE)
Replication lagDistance from primary; must remain below the window> 10 seconds sustained, or > 25% of window
Primary write rate (opcounters)Drives oplog consumption rateSudden 3x+ spike sustained longer than 5 minutes
Secondary apply rateMust equal or exceed primary write rate to prevent lag growthSustained < 80% of primary write rate
Flow control isLaggedPrimary is throttling writes to prevent fallofftrue with growing timeAcquiringMicros
WiredTiger cache dirty ratioWrite surges increase dirty data and checkpoint pressure, compounding lag> 15% sustained

Fixes

Buy time by reducing write volume

The fastest way to stop the window from shrinking is to cut the write rate on the primary. Pause batch imports, defer large migrations, throttle application write threads, and postpone non-urgent index builds. Every eliminated operation extends the oplog window.

If you have identified the specific offending operation and confirmed it is safe to abort, kill it immediately:

db.killOp(<opid>)

Warning: Aborting an in-flight index build, aggregation with $out, or large transaction can trigger rollback and spike disk I/O. Only kill ops you have validated.

Resize the oplog (MongoDB 4.0+)

If the current size cannot support peak write volume, increase it live without restarting:

db.adminCommand({replSetResizeOplog: 1, size: <size_in_MB>})

The size field is specified in megabytes. On MongoDB 5.0+ in mongosh, pass the value as a Double() (e.g., size: Double(20480)) to avoid type coercion issues.

You must run this on each replica set member individually. The command does not propagate. The minimum configurable size is 990 MB. After increasing size, the window grows as new entries are written.

To survive restarts, persist the size in mongod.conf under replication.oplogSizeMB.

Reclaim space after shrinking

If you reduce the oplog size, disk space is not returned to the filesystem automatically because WiredTiger reuses space internally. You can run compact on the collection, or resync the member, to reclaim filesystem space.

Warning: compact blocks the collection and is disruptive. Do not run it during peak load or on the primary without understanding the lock impact.

Recover a secondary that has already fallen off

Once a secondary is “too stale to catch up,” there is no incremental recovery. Remove the member from the replica set and re-add it to trigger a full initial sync:

rs.remove("host:port")
rs.add("host:port")

Plan for the duration to equal your data size divided by network and disk throughput. During initial sync, the secondary builds indexes while copying collections, which often takes longer than the network transfer. The secondary consumes significant I/O and does not serve reads until sync completes. If you want to avoid changing replica set membership, stop the mongod process, wipe its dbPath, and restart; the node will perform an initial sync automatically.

Address chained replication bottlenecks

If geo-distributed secondaries fall off because an intermediate sync source lags behind the primary, force those secondaries to sync directly from the primary or from a closer, low-latency secondary:

db.adminCommand({replSetSyncFrom: "target_host:port"})

This override persists until the next sync source re-evaluation or until the target becomes unavailable. Monitor rs.status() to confirm the change and ensure lag begins to recover.

Prevention

  • Trend the oplog window minimum. Do not rely on the current value. Track the minimum window observed during peak write periods over the last 30 days. If the trend is downward, resize the oplog before you hit the threshold.
  • Size for your worst day. The oplog should maintain at least 24 hours of window during the highest sustained write throughput your cluster has experienced. Busy clusters should target 48 to 72 hours.
  • Alert on lag as a fraction of window. A fixed lag threshold misses the point. Alert when replication lag exceeds 25% of the current oplog window.
  • Monitor secondary apply rate against primary write rate. If apply rate drops below write rate for more than one polling interval, investigate before lag accumulates.
  • Watch flow control activation. Flow control is a safety mechanism, but its presence indicates your cluster is operating at the edge of replication capacity.
  • Match secondary hardware to primary write load. Secondaries with slower disks or lower IOPS than the primary cannot apply operations fast enough during surges. Apply bottlenecks often show up as disk saturation before CPU.

How Netdata helps

  • Correlate primary write throughput with oplog window duration to detect shrinkage before replication lag spikes.
  • Compare per-secondary replication lag with WiredTiger cache pressure to distinguish network delay from apply-side saturation.
  • Expose flow control throttling status to warn when secondaries are near their consumption limit.
  • Alert on cache dirty ratio rises that accompany write surges; primary pressure compounds replication lag.
  • Chart secondary apply rates against primary write rates at per-second resolution to catch falling-behind secondaries in real time.
The Netdata solution

MongoDB monitoring with Netdata

Netdata monitors MongoDB with per-second metrics and automatic dashboards. Watch WiredTiger cache pressure, oplog window, connection counts, checkpoint stalls, and replication health in one place, correlated with the underlying host.