0

I'm seeing very frequent messages like this in mongod.log and doesn't give an exact reason for the server status was very slow. looks like ftdc logs more information but interpreting ftdc log is very tedious method and is not human readable format.

Due to this issue mongo daemon stops working abruptly and becomes stale which results in replication issues and loosing quorum and hence DB inaccessible.

Error log:

2021-04-21T04:56:39.729+0000 I COMMAND [ftdc] serverStatus was very slow: { after basic: 2165, after asserts: 3087, after backgroundFlushing: 8785, after connections: 11612, after dur: 12922, after extra_info: 19620, after globalLock: 27972, after locks: 41890, after logicalSessionRecordCache: 51379, after network: 55947, after opLatencies: 62013, after opcounters: 67473, after opcountersRepl: 70586, after repl: 74168, after security: 78481, after storageEngine: 78629, after tcmalloc: 78629, after transactions: 78629, after transportSecurity: 78629, after wiredTiger: 78813, at end: 79004 }

Question :

how to troubleshoot further ? Enabling verbose 5 logs does gives more information ? Is it truly a memory issue ? what's the next step to avoid this issue ?

0

That means, your server is overload. It can't even reply to the serverStatus command without delay.

Some people solved that by adding more hardware to their server. But, I think first of all you should check your queries and indexes, maybe you can optimize them.

Check out your queries:

db.currentOp()
4
  • I agree with you, but how do I identify what's causing this.. is there a logging that I enable to see what went wrong from mongoDB queries.. how do I isolate this issue. db.currentOp() - how to I capture this information when the actual timestamp when I get this message serverStatus was very slow"" – Bharath Achar Apr 24 at 14:11
  • You can start with profiler like db.setProfilingLevel( 2, { filter: { op: "query", millis: { $gt: 2000 } } } ) – Yunus UYANIK Apr 25 at 10:47
  • It is possible to query profiler output between 2 time period however Is it possible to query ftdc data and does profiler show what's the reason for "serverstatus was very slow" how to catch which point I'm getting this log - "serverstatus was very slow" – Bharath Achar Apr 26 at 3:30
  • You should match profile and mongod.log from the time stamps value and find the expensive queries and optimize them. – Yunus UYANIK Apr 26 at 21:34
0

You should start profiling, enable a slow query log to find out what takes time and how much.

To profile "everything" use:

db.setProfilingLevel(2)

To profile "only" those operations what takes more than 20ms:

db.setProfilingLevel(1, { slowms: 20 })

Here is documentation.

3
  • It is possible to query profiler output between 2 time period however Is it possible to query ftdc data and does profiler show what's the reason for "serverstatus was very slow" how to catch which point I'm getting this log - "serverstatus was very slow" – Bharath Achar Apr 25 at 11:39
  • Have you checked your server's mongod.log -file? Everything is there with time stamps and extended information. – JJussi Apr 26 at 12:05
  • yes I did check mongod.log but max information from the log I could see was that I mentioned in "Error log:" part of my question. – Bharath Achar Apr 26 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.