Significance of MongoDB document movement metrics

Hi All,

In the db.serverStatus() there is a stats called record.move.

The mongoDb documention lacks on this metrics.
When this stats will be incremented?
what is the impact if there is a spike in this stats?
How do we avoid this documentation movement?

Hi @venkataraman_r

This is actually an old MMAPv1 storage engine metrics. It’s not relevant for WiredTiger today, and is unused.

There is actually an explanation of what this metric is in the older version of the MongoDB manual that still includes MMAPv1 as a storage engine (MongoDB 4.0 was the last version that have this): serverStatus — MongoDB Manual

To quote the older doc:

For MMAPv1 Storage Engine, metrics.record.moves reports the total number of times documents move within the on-disk representation of the MongoDB data set. Documents move as a result of operations that increase the size of the document beyond their allocated record size.

In short, the old MMAPv1 storage engine allocates a certain amount of space for each document, and when a document grows beyond its allocated size, it would need to be moved to a larger space. This metric tracks how many times such a move happened. See MMAPv1 Storage Engine — MongoDB Manual if you’re interested in the historical story of how the MMAPv1 storage engine used to work :slight_smile:

Thanks for noticing this, though. I have submitted a JIRA ticket to clean up outdated metrics: SERVER-60514

Best regards
Kevin

1 Like