mongodb - MongoDB(启用日志功能)何时调用 fsync()?

标签 mongodb database nosql

从 1.7.5 版本开始,MongoDB 支持所谓的“单服务器持久性”。根据documentation ,这是通过使用可以在服务器崩溃时回复的预写日志来实现的。

我无法理解 MongoDB 文档中“Journaling”页面的“提交确认”部分:

You can wait for group commit acknowledgement with the getLastError command. When running with --dur, the fsync:true option returns after the data is physically written to the journal (rather than actually fsync'ing). Note that the group commit interval (see above) is considerable: you may prefer to call getLastError without fsync, or with a w: parameter instead with replication. In releases after 1.8.0 the delay for commit acknowledgement will be shorter.

这是否意味着日志记录依赖于操作系统将更改刷新到磁盘?或者这是否意味着无论用户是否请求 fsync,预写日志每 100 毫秒被 fsync 一次?

最佳答案

预写日志每 100 毫秒同步一次。

关于mongodb - MongoDB(启用日志功能)何时调用 fsync()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4872622/

相关文章:

node.js - ( Node :63208) DeprecationWarning: collection. ensureIndex 已弃用。请改用 createIndexes

python - 将 mongodb 返回对象转换为字典

mysql - 如何授予对mysql的root访问权限?

redis - 哪些 maxmemory 策略允许在 Redis 中过期?

relational-database - 临时数据的最佳存储选项

java - java mongodb API 中的查询

python-3.x - 将本地机器上的 MongoDB 迁移到 Mongo Atlas

mysql SELECT WHERE 并再次选择

database - h2 删除约束失败后删除列

transactions - 水平可扩展/可复制的数据库