Skip to content

Commit 7c8e3ac

Browse files
author
Bob Grabar
committed
DOCS-693 review edits
1 parent dc1a5b0 commit 7c8e3ac

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

source/faq/storage.txt

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ inserted into the database. This is caused by the following:
123123
compared to the database and is insignificant.
124124

125125
On UNIX, :program:`mongod` preallocates an additional data file
126-
and initializes the disk space ``0``. Pre-allocating data files in the background prevents
126+
and initializes the disk space ``0``. Preallocating data files in the background prevents
127127
significant delays when a new database file is next allocated.
128128

129129
You can disable preallocation with the :option:`--noprealloc <mongod
@@ -149,12 +149,14 @@ inserted into the database. This is caused by the following:
149149

150150
- The :term:`journal`
151151

152-
The data directory contains the journal, which provides durability by
153-
storing write operations on disk prior to MongoDB applying the
154-
operations to databases. The journal comprises one or more files of up
155-
to 1 gigabyte each. As MongoDB applies write operations to databases,
156-
it removes the operations from the journal files. By default, MongoDB
157-
applies the write operations every 60 seconds.
152+
The data directory contains the journal, which stores write operations
153+
on disk prior to MongoDB applying them to databases. As MongoDB
154+
applies write operations to databases, it removes the operations from
155+
the journal. By default, MongoDB applies the write operations every 60
156+
seconds. Journal files hold 1 gigabyte of data each. If a file fills
157+
up, MongoDB creates a new one. Unless you write *many* bytes of data
158+
per-second, the journal directory should contain only two or three
159+
journal files.
158160

159161
- Empty blocks
160162

@@ -198,6 +200,17 @@ To view specific measures of size, use these methods:
198200
- :method:`totalSize() <db.collection.totalSize()>`: the data size plus the index size.
199201
- :method:`totalIndexSize() <db.collection.totalIndexSize()>`: the index size.
200202

203+
Also, the following scripts will print the stats for each database and
204+
collection:
205+
206+
.. code-block:: javascript
207+
208+
db._adminCommand("listDatabases").databases.forEach(function (d) {mdb = db.getSiblingDB(d.name); printjson(mdb.stats())})
209+
210+
.. code-block:: javascript
211+
212+
db._adminCommand("listDatabases").databases.forEach(function (d) {mdb = db.getSiblingDB(d.name); mdb.getCollectionNames().forEach(function(c) {s = mdb[c].stats(); printjson(s)})})
213+
201214
Can I check the size of indexes?
202215
--------------------------------
203216

@@ -254,9 +267,4 @@ first.
254267
If your server runs out of disk space for journal files, the server
255268
process will exit. By default, journal files are created in the data
256269
directory in a subdirectory called ``journal``, but you may elect to put
257-
the journal files on another disk by using a symlink.
258-
259-
.. todo What should we do with this info:
260-
These one-line scripts will print the stats for each database and collection:
261-
db._adminCommand("listDatabases").databases.forEach(function (d) {mdb = db.getSiblingDB(d.name); printjson(mdb.stats())})
262-
db._adminCommand("listDatabases").databases.forEach(function (d) {mdb = db.getSiblingDB(d.name); mdb.getCollectionNames().forEach(function(c) {s = mdb[c].stats(); printjson(s)})})
270+
the journal files on another disk by using a symlink.

0 commit comments

Comments
 (0)