我在C#代码下面执行 -
for (; ; )
{
Console.WriteLine("Doc# {0}", ctr++);
BsonDocument log = new BsonDocument();
log["type"] = "auth";
BsonDateTime time = new BsonDateTime(DateTime.Now);
log["when"] = time;
log["user"] = "staticString";
BsonBoolean bol = BsonBoolean.False;
log["res"] = bol;
coll.Insert(log);
}
当我在只有512 MB RAM的虚拟64位Linux机器上运行的MongoDB实例(版本2.0.2)上运行它时,我获得了大约5k个插入,其中包含1-2个故障,如mongostat在几分钟后报告的那样。
当对具有8 GB内存的物理Windows机器上运行的MongoDB实例(版本2.0.2)运行相同的代码时,我会在几分钟之后获得mongostat报告的大约80个故障的2.5k插入。
为什么在Windows上出现更多故障?我可以在日志中看到以下消息 - [DataFileSync] FlushViewOfFile 33文件失败
两个实例都禁用日记功能
此外,在具有1-2个故障的虚拟机上插入5k是否足够快?或者我应该期待更好的插入?
答案 0 :(得分:1)
看起来这是一个已知问题 - https://jira.mongodb.org/browse/SERVER-1163
答案 1 :(得分:1)
页面错误计数器实际上是页面总错误,包括硬页面错误和软页面错误。
Process : Page Faults/sec. This is an indication of the number of page faults that
occurred due to requests from this particular process. Excessive page faults from a
particular process are an indication usually of bad coding practices. Either the
functions and DLLs are not organized correctly, or the data set that the application
is using is being called in a less than efficient manner.