设置用于控制日志记录的smallfiles选项不会控制大小 [英] Setting smallfiles option for controlling journaling doesn't control the size

查看:100
本文介绍了设置用于控制日志记录的smallfiles选项不会控制大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发环境中使用mongodb 2.0. 我正在通过配置文件使用以下配置启动mongodb.

I am using mongodb 2.0 for my development environemnt . i am starting mongodb with the following below configuration through a config file .

replSet = ubsc
fork    = true
port    = 27017
dbpath  = /data/mongodb
logpath = /data/mongodb/mongodb.log
rest = true
smallfiles = true

我的问题是,即使我通过配置文件中的设置(smallfiles = true)设置了生成日志的小文件的选项.

My question is that even though i am setting the option of generating smallfiles for the journaling through setting (smallfiles = true ) in my config file .

我仅在5分钟(5-10分钟)内访问了该应用程序,日志文件夹中的文件已增长到一个巨大的大小

I accessed the application only for 5 minutes , (5-10 minutes ) , the file inside the journal folder has grown to a huge size

[mark_user@ubsdvf.oitreo.com journal]$  ls -lrt
total 393632
-rw------- 1 s606970 s606970 134217728 Oct 21 07:41 prealloc.1
-rw------- 1 s606970 s606970 134217728 Oct 21 07:46 prealloc.2
-rw------- 1 s606970 s606970        88 Oct 21 08:42 lsn
-rw------- 1 s606970 s606970 134217728 Oct 21 08:42 j._0

请让我知道为什么文件太大了?

Please let me know why the file has grown to a huge size ??

推荐答案

启用smallfiles后重新启动mongodb服务器后,它将仅适用于新数据库.此配置不会影响任何现有数据库.

Once you restart mongodb server after enabling smallfiles, it will be applied only for new databases. Any existing database will not be affected by this configuration.

通过创建新数据库来测试此配置.

Test this configuration by creating a new database.

此外,文档中提到启用此配置将影响性能.

Also, it is mentioned in the documentation that enabling this configuration will affect the performance.

The smallfiles setting can lead mongod to create many files, which may affect performance for larger databases.

因此请谨慎使用

这篇关于设置用于控制日志记录的smallfiles选项不会控制大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆