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-too-small

Operations Guides

MongoDB oplog window too small: sizing the oplog for your write volume

The oplog window is the only thing standing between a routine secondary restart and a multi-hour full initial sync. It is a fixed-size capped collection that stores a variable amount of history. As your write volume grows, the window compresses. Most teams size the oplog once during initial deployment and never look at it again. Six months later, a routine maintenance window turns into an incident because the secondary fell off the oplog, entered RECOVERING, and forced a resync that saturated the remaining nodes.

This guide explains how the oplog window works, how to size it for your actual write volume, and how to resize it safely without restarting MongoDB.

What the oplog window is and why it matters

MongoDB replicates by having secondaries tail the primary’s operation log. The oplog lives in local.oplog.rs on every replica set member. It is a capped collection with a hard byte limit. When new entries arrive and the collection hits that limit, MongoDB evicts the oldest entries to make room.

The oplog window is the time span between the oldest and newest entry in the oplog. You can inspect it with rs.printReplicationInfo() or programmatically with db.getReplicationInfo(). The field timeDiff (or timeDiffHours) tells you exactly how far behind a secondary can fall before the primary has overwritten the data it still needs.

If a secondary is offline, partitioned, or lagging for longer than the oplog window, it cannot catch up incrementally. It enters RECOVERING and must perform a full initial sync. During that sync, the remaining secondaries absorb more load. If the cluster was already near its oplog limit, losing one member can push a second secondary over the edge. The failure is binary and sudden.

How write volume compresses the window

Because the oplog is capped by bytes, not by time, the window is inversely proportional to write velocity. Higher throughput means faster turnover, which means fewer hours of history fit inside the same allocation.

Not all operations consume oplog space equally. Bulk updates, multi-document deletes, and large transactions generate disproportionately large oplog entries relative to the net data change. A single large multi-document transaction writes one massive entry. A migration script that updates every document in a collection can shrink the window from days to hours in minutes.

This is why monitoring logSizeMB alone is a mistake. logSizeMB only shows the configured cap. The actionable metric is timeDiffHours, and you must track its minimum value during peak traffic, not its average during quiet periods.

flowchart TD
    A[Primary write velocity increases] --> B[Oplog turnover accelerates]
    B --> C[Oplog window shrinks]
    C --> D[Secondary lag exceeds window]
    D --> E[Secondary enters RECOVERING]
    E --> F[Forced full initial sync]

Production sizing rules and tradeoffs

Production oplog windows should stay above 24 to 72 hours at all times. The window must also be greater than twice the longest expected secondary downtime. If you routinely take a node down for four hours during maintenance, the oplog window should never drop below eight hours. In practice, that means sizing for 24 hours as a bare minimum, and 72 hours if you run large secondaries that can take a long time to rebuild.

Size for peak write volume, not average. A bulk import, a backfill job, or a deployment that rebuilds an index can spike writes and temporarily compress the window. If you sized the oplog for average load, that spike becomes an incident.

The classic mistake is to set the oplog once and never trend it. Workloads evolve. Document sizes grow. New batch jobs appear. The window shrinks month by month until it becomes a single-digit hour count.

Workload patternImpact on oplog window
Bulk imports or migrationsCompresses window dramatically during the event
Large multi-document transactionsConsumes large contiguous oplog space per commit
High update or delete volumeGenerates more oplog bytes than net data change
Large individual documentsLarger entry per operation

How to inspect and trend the window

Check the current window and configured size from the primary:

// Inspect oplog window and configured size
rs.printReplicationInfo()

Look at logSizeMB for the cap and timeDiffHours for the actual window. The hours are the signal that matters.

For programmatic monitoring, use db.getReplicationInfo():

var info = db.getReplicationInfo();
print("Oplog window: " + (info.timeDiff / 3600).toFixed(1) + " hours");
print("Configured size: " + info.logSizeMB + " MB");

Correlate this with replication lag to calculate runway:

var status = rs.status();
var primary = status.members.filter(m => m.stateStr === 'PRIMARY')[0];
status.members.filter(m => m.stateStr === 'SECONDARY').forEach(function(s) {
  var lagSec = (primary.optimeDate - s.optimeDate) / 1000;
  var runwayHours = ((info.timeDiff - lagSec) / 3600).toFixed(1);
  print(s.name + " lag: " + lagSec + "s, runway: " + runwayHours + "h");
});

Track the minimum timeDiffHours during your peak load periods. If that minimum drops below your threshold, the oplog is too small for your actual volume.

How to resize the oplog

Starting in MongoDB 4.0, you can resize the oplog dynamically without restarting the node:

// Increase oplog to 16000 MB
db.adminCommand({ replSetResizeOplog: 1, size: 16000 })

The minimum size is 990 MB and the maximum is 1 PB. Since MongoDB 4.0, these changes persist across restarts. After resizing, update mongod.conf under replication.oplogSizeMB so that new members or rebuilds inherit the correct size.

You can also set a minimum retention period:

// Retain at least 24 hours of oplog
db.adminCommand({ replSetResizeOplog: 1, minRetentionHours: 24 })

Be careful with minRetentionHours. When this is set, MongoDB will retain entries for the full period even if the oplog exceeds its configured max size. The oplog can then grow unbounded and consume disk space. It also relies on the host wall clock, so clock skew between replica set members can cause unpredictable retention behavior. Monitor disk space closely if you use this setting.

Shrinking the oplog is more dangerous. Reducing the size immediately truncates the oldest entries. This invalidates open change streams and can force secondaries that have not yet replicated those entries into a full resync. Do not shrink the oplog during production traffic.

If you do shrink it and need to reclaim disk space, run:

// Reclaim disk space after shrinking (run from the "local" database)
db.getSiblingDB("local").runCommand({ compact: "oplog.rs" })

compact on oplog.rs blocks oplog synchronization on that member, so schedule it during a maintenance window. Starting in MongoDB 6.0.2 and 6.1, a secondary can continue replicating while compact runs.

Signals to watch in production

SignalWhy it mattersWarning sign
timeDiffHours from db.getReplicationInfo()Direct measure of catch-up marginMinimum during peak drops below 24 hours
Replication lag vs oplog windowRunway before a secondary falls offLag sustained above 50% of the window
Primary opcounters write ratePredicts how fast the window will shrinkSustained spike without matching oplog capacity
metrics.repl.apply rate on secondariesAbility to catch upApply rate below primary write rate for >10 minutes
flowControl.isLaggedPrimary throttling writes to protect windowtrue with growing timeAcquiringMicros

How Netdata helps

Netdata correlates the signals that predict oplog window collapse before a secondary enters RECOVERING.

  • Correlate shrinking timeDiffHours with opcounters write spikes and replication lag on the same timeline to confirm the window is compressing under load, not just reporting a transient blip.
  • Alert on the minimum oplog window during peak periods, not a simple average, so bulk jobs that run overnight do not create a false sense of safety.
  • Surface flowControl throttling alongside primary write pressure and secondary apply rates. This helps you distinguish between “the oplog is too small” and “the secondary cannot keep up because of disk or CPU saturation.”
  • Track metrics.repl.buffer trends where applicable to detect replication pipeline saturation before lag manifests.
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.