on Ubuntu 12。
降低預先生成的 journal 檔案大小。
# ll /var/lib/mongodb/journal/
total 3147424
drwxr-xr-x 2 mongodb nogroup 4096 Dec 16 23:49 ./
drwxr-xr-x 4 mongodb mongodb 4096 Dec 13 22:53 ../
-rw------- 1 mongodb nogroup 1075453952 Dec 16 23:49 j._68
-rw------- 1 mongodb nogroup 1073741824 Dec 17 14:56 j._69
-rw------- 1 mongodb nogroup 88 Dec 17 14:55 lsn
-rw------- 1 mongodb nogroup 1073741824 Sep 20 18:19 prealloc.2

# vi /etc/mongodb.conf
smallfiles = true
noprealloc = true

# rm /var/lib/mongodb/journal/prealloc.*

# /etc/init.d/mongodb restart
# ll /var/lib/mongodb/journal/
total 393228
drwxr-xr-x 2 mongodb nogroup 4096 Dec 17 14:55 ./
drwxr-xr-x 3 mongodb mongodb 4096 Dec 5 10:29 ../
-rw------- 1 mongodb nogroup 134217728 Dec 17 14:55 j._0
-rw------- 1 mongodb nogroup 134217728 Dec 17 12:05 prealloc.1
-rw------- 1 mongodb nogroup 134217728 Dec 17 12:05 prealloc.2

flyfox 發表在 痞客邦 PIXNET 留言(0) 人氣()