Skip to content

Commit 54b54d6

Browse files
author
Bob Grabar
committed
DOCS-491 review edits
1 parent 529f32c commit 54b54d6

File tree

1 file changed

+39
-42
lines changed

1 file changed

+39
-42
lines changed

source/faq/fundamentals.txt

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ database table, and each document has
4343
one or more fields, which corresponds to a column in a relational
4444
database table.
4545

46-
Collections are have some important differences from RDMS tables:
47-
48-
- Documents in a single collection may have unique combination and set
49-
of fields. Documents need not have identical fields.
50-
51-
- You can add a field to some documents in a collection without adding
52-
that field to all documents in the collection.
46+
Collections have important differences from RDMS tables. Documents in a
47+
single collection may have a unique combination and set of fields.
48+
Documents need not have identical fields. You can add a field to some
49+
documents in a collection without adding that field to all documents in
50+
the collection.
5351

5452
.. see:: :doc:`/reference/sql-comparison`
5553

@@ -174,7 +172,7 @@ SSD, this can be quite slow.
174172

175173
One area to watch specifically in managing the size of your working set
176174
is index access patterns. If you are inserting into indexes at random
177-
locations (for example, with id's, which are effectively randomly
175+
locations (as would happen with id's that are randomly
178176
generated by hashes), you will continually be updating the whole index.
179177
If instead you are able to create your id's in approximately ascending
180178
order (for example, day concatenated with a random id), all the updates
@@ -183,35 +181,37 @@ index pages will be much smaller.
183181

184182
It is fine if databases and thus virtual size are much larger than RAM.
185183

186-
.. _faq-fundamentals-working-set-size:
184+
.. todo Commenting out for now:
185+
186+
.. _faq-fundamentals-working-set-size:
187187

188-
How can I measure working set size?
189-
-----------------------------------
188+
How can I measure working set size?
189+
-----------------------------------
190190

191-
Measuring working set size can be difficult; even if it is much smaller
192-
than total RAM. If the database is much larger than RAM in total, all
193-
memory will be indicated as in use for the cache. Thus you need a
194-
different way to estimate the working set size.
191+
Measuring working set size can be difficult; even if it is much
192+
smaller than total RAM. If the database is much larger than RAM in
193+
total, all memory will be indicated as in use for the cache. Thus you
194+
need a different way to estimate the working set size.
195195

196-
One technique is to use the
197-
`eatmem.cpp <https://github.com/mongodb/mongo-snippets/blob/master/cpp/eatmem.cpp>`_.
198-
utility, which reserves a certain amount of system memory for itself.
199-
You can run the utility with a certain amount specified and see if the
200-
server continues to perform well. If not, the working set is larger than
201-
the total RAM minus the consumed RAM. The test will eject some data from
202-
the file system cache, which might take time to page back in after the
203-
utility is terminated.
196+
One technique is to use the `eatmem.cpp
197+
<https://github.com/mongodb/mongo-snippets/blob/master/cpp/eatmem.cpp>`_.
198+
utility, which reserves a certain amount of system memory for itself.
199+
You can run the utility with a certain amount specified and see if
200+
the server continues to perform well. If not, the working set is
201+
larger than the total RAM minus the consumed RAM. The test will eject
202+
some data from the file system cache, which might take time to page
203+
back in after the utility is terminated.
204204

205-
Running eatmem.cpp continuously with a small percentage of total RAM,
206-
such as 20%, is a good technique to get an early warning if memory is
207-
too low. If disk I/O activity increases significantly, terminate
208-
eatmem.cpp to mitigate the problem for the moment until further steps
209-
can be taken.
205+
Running eatmem.cpp continuously with a small percentage of total RAM,
206+
such as 20%, is a good technique to get an early warning if memory is
207+
too low. If disk I/O activity increases significantly, terminate
208+
eatmem.cpp to mitigate the problem for the moment until further steps
209+
can be taken.
210210

211-
In :term:`replica sets <replica set>`, if one server is underpowered the
212-
eatmem.cpp utility could help as an early warning mechanism for server
213-
capacity. Of course, the server must be receiving representative traffic
214-
to get an indication.
211+
In :term:`replica sets <replica set>`, if one server is underpowered
212+
the eatmem.cpp utility could help as an early warning mechanism for
213+
server capacity. Of course, the server must be receiving
214+
representative traffic to get an indication.
215215

216216
How do I calculate how much RAM I need for my application?
217217
----------------------------------------------------------
@@ -221,7 +221,7 @@ How do I calculate how much RAM I need for my application?
221221
The amount of RAM you need depends on several factors, including but not
222222
limited to:
223223

224-
- The relationship between :ref:`database storage </faq/storage>` and working set.
224+
- The relationship between :doc:`database storage </faq/storage>` and working set.
225225

226226
- The operating system's cache strategy for LRU (Least Recently Used)
227227

@@ -241,13 +241,9 @@ your particular usage.
241241
To calculate how much RAM you need, you must calculate your working set
242242
size, i.e., the portion of your data that is frequently accessed. This
243243
depends on your access patterns, what indexes you have, and the size of
244-
your documents. To calculate working set size, see:
245-
246-
- :ref:`faq-fundamentals-working-set`
247-
248-
- :ref:`faq-fundamentals-working-set-size`
244+
your documents. To calculate working set size, see :ref:`faq-fundamentals-working-set`.
249245

250-
If page faults are low (for example, below than 100 / sec), your
246+
If page faults are infrequent, your
251247
working set fits in RAM. If fault rates rise higher than that, you risk
252248
performance degradation. This is less critical with SSD drives than
253249
with spinning disks.
@@ -305,15 +301,16 @@ directly from the indexes and/or data files.
305301
Are writes written to disk immediately, or lazily?
306302
--------------------------------------------------
307303

308-
Writes are physically written to the journal within 100
304+
Writes are physically written to the :doc:`journal </administration/journaling>` within 100
309305
milliseconds. At that point, the write is "durable" in the sense that
310306
after a pull-plug-from-wall event, the data will still be recoverable after
311307
a hard restart.
312308

313309
While the journal commit is nearly instant, MongoDB writes to the data
314310
files lazily. MongoDB may wait to write data to the data files for as
315-
much as one minute. This does not affect durability, as the journal
316-
has enough information to ensure crash recovery.
311+
much as one minute by default. This does not affect durability, as the journal
312+
has enough information to ensure crash recovery. To change the interval
313+
for writing to the data files, see :setting:`syncdelay`.
317314

318315
What language is MongoDB written in?
319316
------------------------------------

0 commit comments

Comments
 (0)