I have been using dstat for a couple of years now. As a monitoring tools, it’s probably one of the most complete one. Monitoring disk, cpu, systems, … well, the list is long 🙂
As I am currently playing with MongoDB, I was wondering if I could use dstat to monitor my instances. Searching on the wild internet, I found one plugin for MongoDB: https://github.com/gianpaj/dstat.
For my performance tests, I updated this plugin and decided to include a few new features. If you want to have a look, the repo is available at: https://github.com/Dabz/dstat.
The features of these plugins are:
- MongoDB operations counter (–mongodb-opcount), gathering the number of query, insert, update, delete, getmore and commande.
- MongoDB data size statistics (–mongodb-stats), gathering the data size, the index size and the actual size once compressed by wiredTriger.
- MongoDB connection counter (–mongodb-conn), gathering the number of used connection and the number of available
- MongoDB memory information (–mongodb-mem), gathering resident and virtual memory. If MMAPV1 is used, journal memory and page faults are automatically added.
Example:
1 2 3 4 5 6 7 |
./dstat --mongodb-opcount --mongodb-stats --mongodb-conn --mongodb-mem -----------mongodb-counts---------- --mongodb-stats-- mongodb-con mongodb-mem | qry ins upd del gtm cmd |dsize isize ssize| curr avail| res virt | 0 0 0 0 0 0| 855 424 381| 8 811| 1766 2133 | 0 0 0 0 0 7| 855 424 381| 8 811| 1766 2133 | 0 0 0 0 0 5| 855 424 381| 8 811| 1766 2133 |
This plugin also support authentication. DSTAT_MONGODB_USER and DSTAT_MONGODB_PWD environment variable can be set. If a password is set, the plugins try to use them against the admin database.
The DSTAT_MONGODB_HOST (default: 127.0.0.1:27017) variable is used to connect to mongod.
Comments by Dabz
Generating graphs from dstat CSV output
"Oops, sorry, I forgot about your message. You can plot..."
Generating graphs from dstat CSV output
"This could be an issue with your dstat output not matching..."
Generating graphs from dstat CSV output
"Thanks for your feedback ;) I’d like to ask you..."