Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
None
Description
http://docs.mongodb.org/manual/core/journaling/#journal-files
Journal files are append-only files and have file names prefixed with j._. When a journal file holds 1 gigabyte of data, MongoDB creates a new journal file. Once MongoDB applies all the write operations in a particular journal file to the database data files, it deletes the file, as it is no longer needed for recovery purposes. Unless you write many bytes of data per second, the journal directory should contain only two or three journal files.
MongoDB does not actively delete the journal files as the highlighted phrasing suggests. Instead, old journal files lie around until a new one is required. Given that the current one is guaranteed to still be in use at the time a new one is needed, at least two will persist at all times on any instance that has seen reasonable activity in it's current running lifetime.
The two latest journal files will stay around forever while the mongod is running even if you stop all writes. Only when a new journal file is required, are old ones (that are available) recycled for use as the new one.