- Issue updates to specific fields, avoid retrieving the entire document.
- Avoid negation in queries... MongoDB does not index the absence of values.
- Test/explain every query in your application with explain().
- Eliminate unnecessary indexes.
- Use covered queries when possible (queries that exclusively retrieve values that are indexed)
- Make sure to use the latest available MongoDB drivers.
- Store all data for a record in a single document.
- Avoid large documents (use GridFS if you must).
- Manually pad your documents with fields that may later on exist. This helps the Mongo engine from having to move/re-write the document in a separate disk location.
- Avoid large indexed arrays.
- Avoid long field names (repeated field names add-up, and take space!).
- Avoid creating separate indexes for fields already found in compounded indexes.
- Store indexes in a separate disk/volume.
- Use EXT4 or XFS files systems (avoid EXT3).
- Use RAID10 (not RAID0, nor RAID5)
Taken from "Performance Best Practicers for MongoDB", MongoDB 3.0, August 2015.
No comments:
Post a Comment