- Mastering MongoDB 3.x
- Alex Giamas
- 215字
- 2021-08-20 10:10:47
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
推薦閱讀
- Instant Raspberry Pi Gaming
- Mastering Hadoop 3
- Oracle SOA Governance 11g Implementation
- Dreamweaver CS3+Flash CS3+Fireworks CS3創(chuàng)意網(wǎng)站構(gòu)建實(shí)例詳解
- 火格局的時(shí)空變異及其在電網(wǎng)防火中的應(yīng)用
- Apache Hive Essentials
- 大型數(shù)據(jù)庫(kù)管理系統(tǒng)技術(shù)、應(yīng)用與實(shí)例分析:SQL Server 2005
- DevOps:Continuous Delivery,Integration,and Deployment with DevOps
- Implementing Oracle API Platform Cloud Service
- Dreamweaver CS6精彩網(wǎng)頁(yè)制作與網(wǎng)站建設(shè)
- Word 2007,Excel 2007辦公應(yīng)用融會(huì)貫通
- 液壓機(jī)智能故障診斷方法集成技術(shù)
- 筆記本電腦維修之電路分析基礎(chǔ)
- Windows 7故障與技巧200例
- Mastering MongoDB 4.x