Part of series: MongoDB Roadmap
The Dashboard: Monitoring MongoDB Performance
Welcome to Day 4! 🛠️
Flying a plane without instruments is suicide. Running a database without monitoring is negligence.
1. Built-in CLI Tools
These come installed with MongoDB.
mongostat
Shows a real-time table of database status every second.
- insert/query/update/delete: Ops per second.
- dirty: % of cache that needs to be written to disk (High = Bad).
- qr/qw: Queue Read/Write. If > 0, your DB is overloaded!
mongotop
Shows which collections are taking the most time reading/writing. Great for spotting that one collection that is eating 90% of your resources.
2. MongoDB Compass Performance Tab
If you prefer UI, Compass has a “Performance” tab. It shows live graphs of:
- Operations
- Memory Usage
- Hot Collections
3. The Professional Suite: MongoDB Atlas
If you use Atlas, you get:
- Profiler: Automatically captures slow queries (>100ms) and suggests indexes.
- Alerts: SMS/Email when CPU > 80% or Connections > 1000.
- Charts: Visual dashboards for your business metrics (not just server metrics).
4. Third-Party Tools
- Datadog / New Relic: Great if you want to see your DB metrics alongside your Node.js API metrics.
- Percona Monitoring and Management (PMM): The best free, open-source tool for self-hosted instances.
🧠 Daily Challenge
- Open your terminal.
- Run
mongostatwhile running your “Bulk Write” script from Week 4. - Watch the
insertcolumn spike! - Run
mongotopand see your collection name appear at the top.
See you on Day 5 for the Grand Finale: A Distributed Chat App! 🎓