Building Indexes
- Foreground indexes are fase, but block operations
- Background indexes are slow, but don't block operations
For feature compatibility version (fcv) "4.2", all index builds use an optimized build process that holds the exclusive lock only at the beginning and end of the build process. The rest of the build process yields to interleaving read and write operations. MongoDB ignores the background option if specified.
- currentOp()
- killOp(<opid>)
Understanding Explain
Using explain is best way to analyze what heppen when the query executed even without the query being executed.
argument
- queryPlanner (default)
- executionStats
- allPlansExecution
Sort_key_generator: in memory sort
If a sort uses more than 32 mb, then the server is going to cancel that query
Hint()
To select the index to query manually
Resource Allocation for Indexes
- Determine Index Size
- Resource Allocation
- Edge Case
Determine Index Size
- db.stats()
- db.<collection>.stats()
Resource Allocation
Edge Case
- Occasional Reports
- Right-end-side index increments
Basic Benchmarking
Types of Performance Benchmarking
- Public test suite
- Specific or Private Testing environment
Low Level Benchmarking
- File I/O Performance
- Scheduler Performance
- Memory allocation and transfer speed
- Thread performance
- Database server performance
- Translation Isolation
- …
Database server Benchmarking
- Data set load
- Writes per second
- Reads per second
- Balanced work loads
- Read/Write ratio
Distributed Systems Benchmarking
- Linearization
- Serialization
- Fault tolerance