realtebo
realtebo

Reputation: 25637

Mongo is logging slow query log but profiling is zero

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?

Upvotes: 0

Views: 1045

Answers (1)

barrypicker
barrypicker

Reputation: 10088

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).

Upvotes: 1

Related Questions