官术网_书友最值得收藏!

Best practices for write durability

Writing durability can be fine tuned in MongoDB and according to our application design it should be as strict as possible without affecting our performance goals.

Fine tune data flush to disk interval: In the WiredTiger storage engine, the default is to flush data to disk every 60 seconds after the last checkpoint, or after 2 GB of data has been written. This can be changed using the --wiredTigerCheckpointDelaySecs command-line option.

In MMAPv1, data files are flushed to disk every 60 seconds. This can be changed using the --syncDelay command-line option:

  • With WiredTiger, use the XFS filesystem for multi-disk consistent snapshots
  • Turn off atime and diratime in data volumes
  • Make sure you have enough swap space, usually double your memory size
  • Use a NOOP scheduler if running in virtualized environments
  • Raise file descriptor limits to the tens of thousands
  • Disable transparent huge pages, enable standard 4K VM pages instead
  • Write safety should be at least journaled
  • SSD read ahead default should be set to 16 blocks, HDD should be 32 blocks
  • Turn NUMA off in BIOS
  • Use RAID 10
  • Synchronize time between hosts using NTP especially in sharded environments
  • Only use 64-bit builds for production; 32-bit builds are outdated and can only support up to 2 GB of memory

 

主站蜘蛛池模板: 嘉荫县| 双柏县| 安国市| 喀喇沁旗| 商丘市| 遂宁市| 日喀则市| 竹北市| 明星| 肃宁县| 于田县| 炉霍县| 涟源市| 武平县| 固安县| 蓬安县| 龙泉市| 屯门区| 遂溪县| 潼关县| 洪湖市| 宁远县| 阿勒泰市| 赫章县| 涟水县| 冕宁县| 历史| 庐江县| 乡城县| 花莲县| 平和县| 遵义市| 米泉市| 郧西县| 滁州市| 临湘市| 务川| 四子王旗| 万盛区| 康乐县| 阜阳市|