How to detect unused indexes on
#mongodb #mongo #index #unused_indexes
MongoDB
collections?db.your_collection.aggregate([{$indexStats:{}}]).pretty()
ops
displays operations per second on a specific index. If ops is very low compared to other indexes you can drop the index.#mongodb #mongo #index #unused_indexes
If you have a dedicated server only for
Set the readahead setting to 0 regardless of storage media type (spinning, SSD, etc.).
Setting a higher readahead benefits sequential I/O operations. However, since
In general, set the readahead setting to 0 unless testing shows a measurable, repeatable, and reliable benefit in a higher readahead value. MongoDB Professional Support can provide advice and guidance on non-zero readahead configurations.
Ensure that readahead settings for the block devices that store the database files are appropriate. For random access use patterns, set low readahead values. A readahead of 32 (16 kB) often works well.
For a standard block device, you can run
#mongodb #mongo #ra #readahead #mmapv1 #wiredtiger
MongoDB
database I would I highly recommend to set block size as mongo suggested for their engines.For the WiredTiger storage engine:
Set the readahead setting to 0 regardless of storage media type (spinning, SSD, etc.).
Setting a higher readahead benefits sequential I/O operations. However, since
MongoDB
disk access patterns are generally random, setting a higher readahead provides limited benefit or performance degradation. As such, for most workloads, a readahead of 0 provides optimal MongoDB
performance.In general, set the readahead setting to 0 unless testing shows a measurable, repeatable, and reliable benefit in a higher readahead value. MongoDB Professional Support can provide advice and guidance on non-zero readahead configurations.
For the MMAPv1 storage engine:
Ensure that readahead settings for the block devices that store the database files are appropriate. For random access use patterns, set low readahead values. A readahead of 32 (16 kB) often works well.
For a standard block device, you can run
sudo blockdev --report
to get the readahead settings and sudo blockdev --setra <value> <device>
to change the readahead settings. Refer to your specific operating system manual for more information.#mongodb #mongo #ra #readahead #mmapv1 #wiredtiger