Home > Blockchain >  Mongo is logging slow query log but profiling is zero
Mongo is logging slow query log but profiling is zero

Time:11-24

I'm using MongoDb-CE 4.4

I have a 2.4 GB mongod.log file.

I executed

db.setProfilingLevel(0);

I obtained

{ 
    "was" : 0.0, 
    "slowms" : 100.0, 
    "sampleRate" : 1.0, 
    "ok" : 1.0
}

But still it is logging slow query... why?

CodePudding user response:

setting profiling level to zero turns off recording data to the collection system.profile, but will continue to log to the log file any operations slower than slowms. You cannot stop logging slow operations, but you can set the slowms to a high value - db.setProfilingLevel(0, 5000000) which may have the same effect. In this example it will log if it takes more than 5,000,000 ms (i.e., 5,000 seconds).

  • Related