- Newest
- Most votes
- Most comments
There are several things you can try to improve your Document DB performance.
Instance Sizing First, you should try to make sure you are using the right-sized instance based on the performance that you expect. There is some really good information in the documentation to help you make an educated decision. Additionally there are 3rd party sizing calculator.
Index Creating indexes can drastically improve your query performance. However, there is a cost during write transactions.
While indexes can improve query performance by avoiding the need to scan every document in a collection, this improvement comes with a tradeoff. For each index on a collection, every time a document is inserted, updated, or deleted, the database must update the collection and write the fields to each of the indexes for the collection. For example, if a collection has nine indexes, the database must perform ten writes before acknowledging the operation to the client. Thus, each additional index incurs additional write latency, I/O's, and increase in the overall utilized storage.
Monitor Finally, you should consult CloudWatch metrics to identify performance bottlenecks. https://docs.aws.amazon.com/documentdb/latest/developerguide/best_practices.html#best_practices-performance
I hope these help!
Yes I created indexes, however I am not sure I am fully using them. I first tried to create indexes in the mongoose schema, using "index: true" in the field I want to index, but then checking the schema using Compass I could not see them. So I created them directly in Compass. Then, I enabled DocumentDB profiler, and I can see indexes are used when quering from Compass. For some reason, when using the application, the profiler doesn't log anything.
Is there any other way I can check if the application is leveraging indexes?
For index optimization: You can check if any unused indexes with DocumentDB index review tool: https://github.com/awslabs/amazon-documentdb-tools/tree/master/performance/index-review as well as the performance insight. Btw, you can also try the compress the db size with DocumentDB 5.0 https://docs.aws.amazon.com/documentdb/latest/developerguide/doc-compression.html
compression:{
enable: <true | false>
For the query, is there any ReadIOPS spike or network congestion found in the cluster?
Relevant content
- asked 6 months ago
- asked a year ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 8 months ago
- How do I resolve issues with an Amazon DocumentDB instance that is in an incompatible-network state?AWS OFFICIALUpdated 4 years ago
Have you created indexes? - you need to have indexes created for the fields used in your query. If you haven't then some appropriate indexes could significantly speed up query execution.