How to handle slow queries in MongoDB

How to handle Slow Queries in MongoDB

The question is large so I guess my answer will be large too.

  1. Create indexes.
  2. Consider a better data model.
  3. Add more RAM so your “working set” fits in RAM.
  4. Use SSDs.

If you have slow operations, I would solve the issue by trying these solutions in this order.


Any idea why this would be happening?