Profiling MongoDB

framework8 runs on MongoDB. MongoDB profiling is very useful to optimise performance. Especially if you are querying custom properties. Profiling enables you to see where the slow queries are occurring and helps you to work out the appropriate indexing.



Mongo db profiling can be switched on using:

db.setProfilingLevel(2)

The results can then be queried:

db.system.profile.find( { millis : { $gt :100} , op:"query" } ).pretty().sort({ts:-1})

RoboMongo is a good GUI to use for calling the profile query if you don't want to use the command line. It can be downloaded https://robomongo.org/

More information on profiling can be found here: https://docs.mongodb.com/manual/tutorial/manage-th...