@@ -123,7 +123,7 @@ inserted into the database. This is caused by the following:
123
123
compared to the database and is insignificant.
124
124
125
125
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
127
127
significant delays when a new database file is next allocated.
128
128
129
129
You can disable preallocation with the :option:`--noprealloc <mongod
@@ -149,12 +149,14 @@ inserted into the database. This is caused by the following:
149
149
150
150
- The :term:`journal`
151
151
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.
158
160
159
161
- Empty blocks
160
162
@@ -198,6 +200,17 @@ To view specific measures of size, use these methods:
198
200
- :method:`totalSize() <db.collection.totalSize()>`: the data size plus the index size.
199
201
- :method:`totalIndexSize() <db.collection.totalIndexSize()>`: the index size.
200
202
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
+
201
214
Can I check the size of indexes?
202
215
--------------------------------
203
216
@@ -254,9 +267,4 @@ first.
254
267
If your server runs out of disk space for journal files, the server
255
268
process will exit. By default, journal files are created in the data
256
269
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