Diving deep into the essentials of MongoDB Atlas diagnostics and debugging, helps you ensure optimal performance for your cloud-based databases. Join us as we explore key strategies and best practices for effective database management in the cloud environment. Get ready to elevate your MongoDB Atlas experience and unlock the full potential of your cloud databases.
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud Mydbops Opensource Database Meetup 15
1. Mastering MongoDB Atlas:
Essentials of Diagnostics and Debugging in the Cloud
Manosh Malai
CTO, Mydbops LLP
Mydbops Open Source Database Meetup - 15th Edition
2. About Me
Manosh Malai
❏ Interested in Open Source technologies
❏ Interested in MongoDB, DevOps & DevOpSec Practices
❏ Tech Speaker/Blogger
❏ MongoDB User Group Leader(Bangalore)
9. ❏ MongoDB Atlas is a fully-managed cloud database service provided by MongoDB.
❏ It offers high-performance data handling capabilities for modern applications with a scalable, secure,
and intuitive approach.
Introduction
10. ❏ Multi-region, Multi-cloud: Run robust applications across multiple regions or clouds
simultaneously, ensuring high resilience and flexibility.
❏ Serverless and Elastic: Deploy a serverless database infrastructure that scales dynamically, allowing
you to pay only for the resources you use.
❏ Always-on Security: Experience top-tier security with default settings for access control and
end-to-end encryption to safeguard your data.
❏ Performance Advice: Receive tailored index and schema design recommendations as your workload
evolves, optimizing database performance.
Atlas Platform Service
11. ❏ Native Tooling: Enjoy seamless connectivity with command line access and integration with your
preferred programming languages.
❏ Automated Data Tiering: Efficiently manage data storage costs with rules-based archival, adapting
as your data estate grows.
❏ Continuous Backups: Ensure data integrity with point-in-time recovery, enabling precise restoration
to any required moment.
❏ Workload Isolation: Enhance performance with dedicated secondary nodes for local reads or
analytics, ensuring optimal resource utilization.
Key Features
16. Live monitoring of database operations.
Purpose
Functionality Provides a real-time view of database activities such as queries,
updates, and other operations.
Limitations
- Data Granularity and Retention: Limited long-term data
storage, focusing on immediate data.
- Historical Data Analysis: Requires additional tools for in-depth
historical analysis
Key Benefits
- Immediate Visibility: Instant insights into operational state.
- Operational Management: Enables real-time monitoring and
management of database operations.
Real-Time Performance Panel: Features and Limitations
17. 01
Monitoring Data Storage Granularity:
● Atlas stores metrics data at varying granularity levels, averaging data
from the previous level for each increase in granularity.
● Default granularity is at 1-minute intervals, with data compaction
over time for longer retention.
02
Premium Monitoring Granularity:
● Available for clusters M40 and larger, providing 10-second granularity.
● Premium monitoring gathers more detailed data and is enabled for all
clusters in the project once an M40 or larger cluster is deployed.
MongoDB Atlas: Data Storage Granularity and Monitoring
18. 03
Data Compaction:
● Initial 48 Hours: Records data every minute.
● After 48 Hours: Compacts 60 minutes of data into one hourly summary.
● After 63 Days: Combines 24 hours of summaries into one daily summary.
MongoDB Atlas: Data Storage Granularity and Monitoring
04
Additional Considerations:
● Free/Shared Clusters (M0, M2, M5): Limited metrics; monitoring
halts after 7 inactive days.
● Serverless Instances: Limited metrics and charts.
● Log Data: Max 2000 lines retained every 2 minutes.
20. ❏ Overview: Integrate Atlas with Prometheus for advanced metrics collection, rule evaluation,
and alert triggering
❏ Limitations: Not available for Atlas for Government.
❏ Prerequisites: Requires M10+ clusters and a configured Prometheus instance.
❏ Available Metrics: Includes MongoDB Information Metrics, serverStatus, replSetStatus, and
various hardware metrics.
❏ Advantage: Prometheus stores historical data, which is vital for analyzing long-term trends and
making strategic improvements to database performance.
MongoDB Atlas Integration with Prometheus
23. ❏ Only available from M10+ clusters and serverless instances.
❏ Automatically identifies and analyzes slow queries.
❏ Indexes are ranked as High or Medium Impact based on wasted bytes read, indicating
potential efficiency improvements.
❏ Suggests indexes to improve query performance.
❏ Recommend up to 20 query shapes from all collections in the cluster and suggests indexes to
enhance their performance.
❏ Minimal impact on overall cluster performance.
MongoDB Atlas Performance Advisor
25. ❏ The Performance Advisor customizes index field order based on the type of query operation.
❏ Field order is largely determined by the cardinality of fields in the queries.
Operation Type
Rank Example
1 Equality $eq
2 Array query $in
3 Range Query $gte
4 Type Query $type
5 Exists $exists
6 All other Operators
7 Sort sort()
Key Aspects of Index Ranking in MongoDB Atlas Performance Advisor
26. ❏ Only available from M10+ clusters and serverless instances.
❏ Flags an index as unused if it hasn't supported a query in over 7 days.
❏ Focuses on the 20 most active collections for identifying unused indexes.
❏ Hidden indexes are recommended for dropping(for MongoDB 4.4+)
❏ Redundant indexes are marked with a red 'Redundant' badge.
Drop Index Recommendations MongoDB Atlas Performance Advisor
27. ❏ Identifies slow-running queries with key statistics displayed in the Atlas UI.
❏ Only available on M10+ clusters and serverless instances
❏ Offers historical query analysis for up to 24 hours without added cost or performance overhead.
❏ db.setProfilingLevel command allows customization of profiling levels.
❏ Atlas-managed slow operation threshold is enabled by default but can be opted out for a fixed
slow query threshold of 100 milliseconds.
❏ M0, M2, M5 clusters and serverless instances have this feature disabled by default.
❏ Push log to S3
Monitoring Query Performance in MongoDB Atlas
28. ❏ Displays only up to 10,000 of the most recent operations or 10MB of the most recent logs.
❏ New operations won’t be displayed for 24 hours once the limit is reached.
❏ Profiler charts limited to displaying a maximum of 10,000 data points.
❏ Log data is processed in batches with a possible delay of up to 5 minutes.
❏ In case of high activity spikes and large log volumes, Atlas may temporarily stop collecting new
logs.
Monitoring Query Performance in MongoDB Atlas: Limitation
30. ❏ PIM troubleshoot principal developed by Mydbops, Its combining the Scientific Method and
Isolation Forest
❏ Start: CPU Utilization Alert Received in Slack.
❏ Define the Problem:
❏ Identify high CPU usage symptoms.
❏ Establish baseline CPU usage.
❏ Gather Data:
❏ Collect CPU usage data and system activities from monitoring tools.
❏ Investigate recent environmental changes.
❏ Formulate Hypotheses:
❏ Infer potential causes (inefficient queries, increased traffic).
Consider other factors (background processes).
Precision Isolation Method(PIM) For CPU Utilization Analysis
31. ❏ Isolation Forest:
❏ Real-Time Performance Panel: Immediate overview of current operations and CPU usage.
❏ Query Performance Analysis: Identify inefficient or heavy queries.
❏ Performance Advisor Insights: Seek indexing and schema optimization advice.
❏ Refine Isolation Forest:
❏ Isolate causes by adjusting one factor at a time.
❏ Utilize MongoDB Atlas insights for guidance.
❏ Iterative Testing and Monitoring:
❏ Implement changes suggested by the Performance Advisor.
❏ Observe the impact in real-time and refine based on feedback.
❏ Resolution Achieved?:
❏ Yes: Document the process and solution. End.
❏ No: Return to "Formulate Hypotheses" or earlier steps as needed.
Precision Isolation Method(PIM) For CPU Utilization Analysis