To operate MongoDB efficiently, you need to have insight into database performance. And with that in mind, we’ll dive into monitoring in this second webinar in the ‘Become a MongoDB DBA’ series. MongoDB offers many metrics through various status overviews and commands, but which ones really matter to you? How do you trend and alert on them? What is the meaning behind the metrics?
We’ll discuss the most important ones and describe them in ordinary plain MySQL DBA language. And we’ll have a look at the open source tools available for MongoDB monitoring and trending. Finally, we’ll show you how to leverage ClusterControl’s MongoDB metrics, dashboards, custom alerting and other features to track and optimize the performance of your system.
AGENDA
How does MongoDB monitoring compare to MySQL
Key MongoDB metrics to know about
Trending or alerting?
Available open source MongoDB monitoring tools
How to monitor MongoDB using ClusterControl
Demo
SPEAKER
Art van Scheppingen is a Senior Support Engineer at Severalnines. He’s a pragmatic MySQL and Database expert with over 15 years experience in web development. He previously worked at Spil Games as Head of Database Engineering, where he kept a broad vision upon the whole database environment: from MySQL to Couchbase, Vertica to Hadoop and from Sphinx Search to SOLR. He regularly presents his work and projects at various conferences (Percona Live, FOSDEM) and related meetups.
2. Confidential
Logistics
☐ Webinar is recorded
☐ Replay available soon
☐ Feel free to ask questions at any time
☐ Use your control panel to contact us
☐ Or email us as well: info@severalnines.com
3. Confidential
Agenda
☐ Trending and alerting
☐ Why do we collect data?
☐ How does MongoDB monitoring compare to MySQL
☐ Key MongoDB metrics to know about
☐ Available open source MongoDB monitoring tools
☐ How to monitor MongoDB using ClusterControl
☐ Demo
7. Confidential
Monitoring vs trending
☐ Monitoring system (i.e. Nagios)
☐ Checks if services are healthy
☐ Sends pages
☐ Trending system (i.e. Cacti, Graphite)
☐ Collects metrics
☐ Generate graphs
8. Confidential
Monitoring: Availability
☐ Do more than just opening a connection
☐ Measure true status of nodes and cluster
☐ Test read/write
☐ Open essential databases and collections
☐ Keep an eye on the replication lag
☐ Increase oplog size?
☐ Check the full topology
9. Confidential
Trending: Why do we need trends?
☐ Trending
☐ Plot trends of key (performance) metrics
☐ Find problems before they arise
☐ Pre-emptive problem management
☐ Trending tools
☐ Granularity of sampling
☐ More datapoints = better
11. Confidential
Why do we collect data?
☐ Periodical (daily/weekly) healthchecks
☐ Insight into all aspects of the database operations
☐ Post mortem and proactive monitoring
☐ Capacity planning
12. Confidential
Healthchecks
☐ Healthchecks are a pain
☐ You want to see aggregated
data
☐ You want to be able to drill down
to a particular host
☐ You want to see the most
important data first and dig in
later on
13. Confidential
Post mortem and proactive monitoring
☐ Ability to dig into past data
☐ Even less than 5s of data
granularity (hardware-
dependent)
☐ Low granularity allows you to
catch the issue as it evolves -
no need to wait 5 minutes for a
graph to refresh
14. Confidential
Insight into internals, capacity planning
☐ Graphs based on MySQL
status counters
☐ Overall status and per-node
graphs
☐ Ability to get a timeshifted
graphs - useful for comparing
workload changes across the
time
16. Confidential
Type of metrics to collect
☐ Quite similar to MySQL
☐ Host metrics
☐ Operational metrics
☐ Storage engine metrics
☐ Replication metrics
17. Confidential
Host Metrics: what for?
☐ Similar to most other databases
☐ Understand the utilization of the hardware
☐ Capacity planning
☐ Determine the type of an issue
☐ I/O related?
☐ CPU related?
☐ Network related?
18. Confidential
Host Metrics: what to look for?
☐ CPU utilization (should I add more nodes to the cluster?)
☐ Network utilization (am I running out of bandwidth?)
☐ Ping (how badly latency affects my MongoDB cluster?)
☐ Disk throughput and IOPS (am I within my hardware limits?)
☐ Disk space (do I have to plan for larger disks?)
☐ Memory utilization (do I suffer from a memory leak?)
19. Confidential
Operational metrics
☐ Similar to most other databases
☐ Throughput of the cluster
☐ Relate throughput to cluster performance
☐ Determine the type of an issue
☐ Request spikes?
☐ Write amplification related?
☐ Queueing?
20. Confidential
Storage engine metrics
☐ Storage engine specific
☐ MMAP
☐ Wired Tiger
☐ MongoRocks
☐ Insight in how the engine performs
☐ Internal congestion
21. Confidential
Replication Metrics
☐ Throughput of the replication
☐ Durability of the oplog
☐ Replication lag
☐ Comparable to Galera replication
☐ Quorum based
☐ At least one secondary needs to acknowledge
24. Confidential
Oplog
☐ Similar to MySQL binary logs
☐ Oplog: a special collection
☐ Limited size
☐ Eviction of transactions (FIFO)
☐ Replication window
☐ Time between first and last transaction in the oplog
28. Confidential
Connections
☐ Similar to MySQL when handling connections
☐ Client drivers may support connection pooling
☐ Multiple non-blocking queries can use the same connection
☐ Spawns new connections when low on threshold
☐ Increase of connections
☐ Locking issues
☐ Application request bursts
30. Confidential
Transactions
☐ Atomicity on document level
☐ No “real” transactions
☐ Write data with the $isolated operator
☐ Similar to READ UNCOMMITTED
☐ No rollback
☐ Does not work on shards
41. Confidential
Zabbix
☐ MongoDB Zabbix monitoring plugin
☐ https://github.com/nightw/mikoomi-zabbix-mongodb-monitoring
☐ All the necessary metrics and more
☐ Entries in oplog
☐ Pre-canned triggers
54. Confidential
Additional Resources
☐ Blog series: Become a MongoDB DBA
☐ http://severalnines.com/blog-categories/mongodb
☐ Webinar series: Become a MongoDB DBA
☐ http://severalnines.com/upcoming-webinars
☐ Visit our website for more resources!
☐ http://www.severalnines.com