Skip to content

Instantly share code, notes, and snippets.

@imlucas
Created January 18, 2017 14:36
Show Gist options
  • Save imlucas/54ae14920c5a6ec97f2566f14ee197dd to your computer and use it in GitHub Desktop.
Save imlucas/54ae14920c5a6ec97f2566f14ee197dd to your computer and use it in GitHub Desktop.
MongoDB Binary Sizes

All Binaries in Tarball

14 file(s) with total size 187.95MB

┌──────────────┬───────────┐
│ Binary Name  │ File Size │
├──────────────┼───────────┤
│ bsondump     │ 4.52MB    │
├──────────────┼───────────┤
│ mongo        │ 21.15MB   │
├──────────────┼───────────┤
│ mongod       │ 39.23MB   │
├──────────────┼───────────┤
│ mongodump    │ 8.08MB    │
├──────────────┼───────────┤
│ mongoexport  │ 6.13MB    │
├──────────────┼───────────┤
│ mongofiles   │ 6.01MB    │
├──────────────┼───────────┤
│ mongoimport  │ 6.29MB    │
├──────────────┼───────────┤
│ mongooplog   │ 5.79MB    │
├──────────────┼───────────┤
│ mongoperf    │ 38.86MB   │
├──────────────┼───────────┤
│ mongoreplay  │ 8.92MB    │
├──────────────┼───────────┤
│ mongorestore │ 9.42MB    │
├──────────────┼───────────┤
│ mongos       │ 21.20MB   │
├──────────────┼───────────┤
│ mongostat    │ 6.34MB    │
├──────────────┼───────────┤
│ mongotop     │ 5.98MB    │
└──────────────┴───────────┘

Server Only

2 file(s) with total size 60.43MB

┌─────────────┬───────────┐
│ Binary Name │ File Size │
├─────────────┼───────────┤
│ mongod      │ 39.23MB   │
├─────────────┼───────────┤
│ mongos      │ 21.20MB   │
└─────────────┴───────────┘

Dump Restore Only

2 file(s) with total size 17.50MB

┌──────────────┬───────────┐
│ Binary Name  │ File Size │
├──────────────┼───────────┤
│ mongodump    │ 8.08MB    │
├──────────────┼───────────┤
│ mongorestore │ 9.42MB    │
└──────────────┴───────────┘

Import Export Only

2 file(s) with total size 12.43MB

┌─────────────┬───────────┐
│ Binary Name │ File Size │
├─────────────┼───────────┤
│ mongoimport │ 6.29MB    │
├─────────────┼───────────┤
│ mongoexport │ 6.13MB    │
└─────────────┴───────────┘

Other Stuff Only

8 file(s) with total size 97.58MB

┌─────────────┬───────────┐
│ Binary Name │ File Size │
├─────────────┼───────────┤
│ bsondump    │ 4.52MB    │
├─────────────┼───────────┤
│ mongo       │ 21.15MB   │
├─────────────┼───────────┤
│ mongofiles  │ 6.01MB    │
├─────────────┼───────────┤
│ mongooplog  │ 5.79MB    │
├─────────────┼───────────┤
│ mongoperf   │ 38.86MB   │
├─────────────┼───────────┤
│ mongoreplay │ 8.92MB    │
├─────────────┼───────────┤
│ mongostat   │ 6.34MB    │
├─────────────┼───────────┤
│ mongotop    │ 5.98MB    │
└─────────────┴───────────┘
var _ = require('lodash');
var numeral = require('numeral');
var Table = require('cli-table');
var BIN_TO_SIZE = {
bsondump: 4739848,
mongo: 22175876,
mongod: 41138832,
mongodump: 8471312,
mongoexport: 6432736,
mongofiles: 6305520,
mongoimport: 6599008,
mongooplog: 6070704,
mongoperf: 40748912,
mongoreplay: 9357168,
mongorestore: 9882032,
mongos: 22228408,
mongostat: 6651056,
mongotop: 6275488
};
function tableize(title, keys) {
console.log(`## ${title}`);
console.log(_.repeat('-', 28));
var t = new Table({
head: ['Binary Name', 'File Size']
});
var sizes = _.map(keys, (k) => {
t.push(
[k, numeral(BIN_TO_SIZE[k]).format('0.00b')]
);
return BIN_TO_SIZE[k];
});
console.log(t.toString());
console.log(`${keys.length} file(s) with total size ${numeral(_.sum(sizes)).format('0.00b')}\n\n`);
}
var ALL_BINS = Object.keys(BIN_TO_SIZE);
var SERVER_BINS = ['mongod', 'mongos'];
var DUMP_RESTORE_BINS = ['mongodump', 'mongorestore'];
var IO_BINS = ['mongoimport', 'mongoexport'];
var OTHER_BINS = _.difference(ALL_BINS, SERVER_BINS.concat(DUMP_RESTORE_BINS, IO_BINS));
tableize('Everything', ALL_BINS);
tableize('Server Only', SERVER_BINS);
tableize('Dump Restore Only', DUMP_RESTORE_BINS);
tableize('Import Export Only', IO_BINS);
tableize('Other Stuff Only', OTHER_BINS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment