Oplog size is the configured storage capacity allocated to a MongoDB replica-set member’s oplog. MongoDB creates a default-sized oplog when a member starts unless you specify a size. section 9.1.3
Use replication information to compare capacity, usage, and the available oplog window:
- configuredLogSizeMB reports the configured capacity, while logSizeMB reports the actual oplog size. section 9.1.3
- usedMB shows how much capacity contains replication data. section 9.1.3
- timeDiff and timeDiffHours show the interval between the earliest and latest oplog entries, indicating the available oplog window. section 9.1.3
Inspect the configured capacity
Run db.getReplicationInfo(). An output with configuredLogSizeMB: 4096, logSizeMB: 4096, and usedMB: 4074.63 shows a 4096 MB oplog that is nearly full; timeDiffHours: 176.43 indicates the represented time span.
Listing 9.3 A single document from the oplog collection
{
op: 'd',
ns: ' sample_mflix.sessions',
ui: new UUID("99f8f10f-e144-4419-a543-da211dd1a2de"),
o: { _id: ObjectId("65b1a0a4edf7e1f8d9ccc396") },
ts: Timestamp({ t: 1710267182, i: 5 }),
t: Long("38"),
v: Long("2"),
wall: ISODate("2024-03-12T18:13:02.838Z")
},
Inspect a single oplog document to see an operation, namespace, timestamp, and wall-clock time stored in the oplog. section 9.1.3
