Database Reference
In-Depth Information
created before starting MongoDB for faster initial performance. Otherwise,
MongoDB pauses each time it needs to create a new file, which can be quite
often if the server is joining an existing cluster of servers and replicating
all existing data. On UNIX-like systems, this is easily accomplished using
the dd command to create empty files. For example, this MongoDB install
contains only the initial system database called local :
$ ls -lh
total 163840
drwxr-xr-x 2 bellis staff 68B Dec 6 21:29 journal
-rw------- 1 bellis staff 64M Dec 2 20:07 local.0
-rw------- 1 bellis staff 16M Dec 2 20:07
local.ns
To add a new database called big, files of 2GB each are created using the dd
command. The database is expected to require approximately 4GB of space,
so 2 files are created:
$ dd if=/dev/zero of=./big.0 bs=1048576 count=2048
2048+0 records in
2048+0 records out
2147483648 bytes transferred in 8.599453 secs
(249723278 bytes/sec)
$ dd if=/dev/zero of=./big.1 bs=1048576 count=2048
2048+0 records in
2048+0 records out
2147483648 bytes transferred in 13.700213 secs
(156748195 bytes/sec)
$ ls -lh
total 8552448
-rw-r--r-- 1 bellis staff 2.0G Mar 7 11:42 big.0
-rw-r--r-- 1 bellis staff 2.0G Mar 7 11:42 big.1
drwxr-xr-x 2 bellis staff 68B Dec 6 21:29 journal
-rw------- 1 bellis staff 64M Dec 2 20:07 local.0
-rw------- 1 bellis staff 16M Dec 2 20:07
local.ns
Search WWH ::




Custom Search