I I want to record the slow query of mongo, but I don't know how long to set it. How long do you usually set it?
I I want to record the slow query of mongo, but I don't know how long to set it. How long do you usually set it?
You can set it in operationProfiling Options in Configuration file or as parameter --slowms <integer>, see https://www.mongodb.com/docs/manual/reference/program/mongod/#std-option-mongod.--slowms
Default is 100ms. Set it according to your retirements. If your application runs many big queries then the logfile may become bigger and a higher threshold could be better.