-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: MMAPv1
-
None
-
Storage Execution
-
Fully Compatible
While ns files are small at 64MB, allocating them requires us to zero the file. On HDD, the process of file allocation + file zeroing can have a wide variation in performance, and it would be really helpful to time these steps in MongoD to diagnose I/O related problems causing MongoDB to stall.
Example Code:
diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp index 12e90d2..f323bf8 100644 --- a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp +++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp @@ -181,6 +181,8 @@ void NamespaceIndex::init(OperationContext* txn) { unsigned long long l = mmapv1GlobalOptions.lenForNewNsFiles; log() << "allocating new ns file " << pathString << ", filling with zeroes..." << endl; + Timer nsFileTimer; + { // Due to SERVER-15369 we need to explicitly write zero-bytes to the NS file. const unsigned long long kBlockSize = 1024 * 1024; @@ -227,6 +229,10 @@ void NamespaceIndex::init(OperationContext* txn) { p = _f.getView(); } + + log() << "done allocating ns file " << pathString << ", " + << "size: " << l / 1024 / 1024 << "MB, " + << " took " << ((double)nsFileTimer.millis()) / 1000.0 << " secs" << endl; } if (p == 0) {
- duplicates
-
SERVER-29284 Log time spent allocating mmap NS files
- Closed
- is duplicated by
-
SERVER-24736 ns file allocations should include timing info
- Closed