By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Why is my IO cost so high for documentdb

0

We had a grant for non-profits of $5000 which we expected to cover a whole year but after a few months we are seeing very high bills. After some investigation (not very easy because cost and usage explorer does not show the amount when credits are offsetting them), we determined that the DocumentDB database has extremely high IO - 6,017,157,755 IOs (at least much higher than we were told it would be).

We have an SQS queue that feeds into a lambda and then into the database but the numbers are no way that high. How do we determine what is going on? I am very new to this kind of troubleshooting.

Thanks

3 Answers
0

High IO costs in Amazon DocumentDB can be caused by several factors, and it's important to investigate the root cause to optimize your database performance and reduce costs. Here are some steps you can take to troubleshoot and potentially resolve the issue:

  1. Analyze database load: Use the Performance Insights dashboard to review the Database load chart. Look for incidents where the database load exceeds the Max CPU line. This can help identify if there are performance bottlenecks causing excessive IO operations.

  2. Examine wait states: In the Performance Insights dashboard, identify which wait states are primarily responsible for the load. IO-related wait states might indicate issues with disk reads or writes.

  3. Investigate top queries: Use the Top queries tab in Performance Insights to see which queries are contributing most to the load. Look at the Load by Wait (AAS) column to identify digest queries causing high IO.

  4. Check for sequential scans: Your application might be performing operations that result in sequential scans of large tables. This can cause high IO if data isn't efficiently cached in memory. Look for tables with high seq_scan values by querying pg_stat_user_tables.

  5. Analyze cache performance: Examine cache hit and miss statistics, including collection-level and index-level cache statistics. Poor cache performance can lead to increased IO as data needs to be read from disk more frequently.

  6. Review indexing: Analyze index usage and identify any missing or unused indexes. Proper indexing can significantly reduce IO by allowing the database to quickly locate data without scanning entire collections.

  7. Monitor connections: Check if there are connection spikes that might be causing increased IO. You can use Amazon CloudWatch to monitor the DatabaseConnections metric.

  8. Examine data ingestion patterns: If you're ingesting large amounts of data, this could be contributing to high IO. Consider optimizing your data ingestion process or scheduling it during off-peak hours.

  9. Review instance size: If the high IO is due to your workload exceeding the capacity of your current instance, consider scaling up to a larger instance type with more CPU and memory resources.

  10. Distribute read traffic: If your primary instance has high CPU utilization but replicas don't, consider distributing read traffic across replicas using client read preference settings (e.g., secondaryPreferred).

  11. Add more replicas: If all cluster instances have high CPU utilization and you're already using replicas for reads, adding more replicas can increase resources available for read traffic.

To get more detailed information about your specific situation, you may need to dive deeper into query analysis and performance monitoring tools provided by Amazon DocumentDB. If you're new to this kind of troubleshooting, it might be helpful to consult with an experienced database administrator or reach out to AWS support for more tailored guidance.
Sources
Performance Insights concepts - Amazon DocumentDB
IO:DataFileRead - Amazon Relational Database Service
Performance and resource utilization - Amazon DocumentDB
Analyzing database load by wait states - Amazon DocumentDB

profile picture
answered 13 days ago
profile pictureAWS
EXPERT
reviewed 13 days ago
0

Hello

Sorry to see the trouble here.

If you have further specifics you'd like explained regarding your bill, I'd suggest opening a case with our Billing team. They would be happy to look into it with you. You can do so, here in our Support Center.

- Ann D.

profile pictureAWS
EXPERT
answered 13 days ago
0

Tip. When using cost explorer you can hide charges: select exclude credits.

This will help you much more looking into costs.

profile picture
EXPERT
answered 13 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions