rueckstiess / mtools

A collection of scripts to set up MongoDB test environments and parse and visualize MongoDB log files.
Apache License 2.0
1.89k stars 404 forks source link

mlaunch calls mongod --version and mongod --help repeatedly #816

Closed ajdavis closed 4 years ago

ajdavis commented 4 years ago

When mongod and mongos are dynamically linked they can take many seconds to start up. This startup cost is multiplied when creating a cluster with mlaunch, because mlaunch executes "mongod --help" and "mongod --version" many times. On my machine:

> time /mirror/co/mtools/mtools/mlaunch/mlaunch.py init --replicaset 3 --binarypath
94.79s user 1.02s system 94% cpu 1:40.85 total

If I cache the output of these two shell commands so mlaunch calls each only once:

time /mirror/co/mtools/mtools/mlaunch/mlaunch.py init --replicaset 3 --binarypath
36.91s user 0.45s system 88% cpu 42.395 total