Is db.stats () a blocking call for MongoDB?

While researching how to check MongoDB size, I found this comment :

Be warned that dbstats is blocking your database during its startup, so it is not suitable for production. https://jira.mongodb.org/browse/SERVER-5714

Looking at the related error report (which is still open), he quotes Mongo docs as :

The command takes some time to start, usually a few seconds, if the .ns file is very large (using --nssize). At startup, other operations may be blocked.

However, when I check the current Mongo documents, I do not find this text. Instead they say :

The execution time of the command depends on the total size of the database. Since the command must touch all data files, it may take several seconds to execute this command.

For MongoDB instances using the WiredTiger storage engine, after an unclean shutdown, size and count statistics can be disabled for up to 1000 documents, which are reported by the collStats, dbStats, count command. To restore the correct statistics for the collection, run a validation on the collection.

Does this mean that the WiredTiger storage WiredTiger changed this to a non-blocking call, retaining current statistics?

+3
source share

Source: https://habr.com/ru/post/921295/


All Articles