[DOCS-6149] Document the meaning of the fields in the slow query log Created: 04/Sep/15  Updated: 30/Oct/23  Resolved: 06/Jan/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Critical - P2
Reporter: Daniel Pasette (Inactive) Assignee: Unassigned
Resolution: Won't Do Votes: 5
Labels: ready-for-work, reopened
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Days since reply: 1 year, 4 weeks, 5 days ago
Epic Link: DOCSP-26173

 Description   

A frequent a source of confusion is how to read and interpret the fields returned in the slow operation log. Making things a bit worse, it has also changed release over release.

One question that comes up often:
Q. How does the server count a slow query?
A. The time used as the threshold for a slow query is calculated from the moment a query acquires the first lock. The timeAcquiringMicros field is included for Global, Database, Collection, Oplog, Journal. These counters are ticking from when the operation first attempts to grab a lock. Thus, the total time reported for an operation (at the end of the line and used for the slowms threshold) may be less than if all the times printed in the log line are added up.

Example log line from v3.0:

2015-09-03T18:01:46.885Z I QUERY    [conn140189] getmore entities-collection cursorid:78668055085 ntoreturn:0 keyUpdates:0 writeConflicts:0 numYields:61 nreturned:4569 reslen:4194808 locks:{ Global: { acquireCount: { r: 124 }, acquireWaitCount: { r: 14 }, timeAcquiringMicros: { r: 187331912 } }, Database: { acquireCount: { r: 62 } }, Collection: { acquireCount: { r: 62 } } } 42544ms



 Comments   
Comment by Rachelle Palmer [ 06/Jan/23 ]

Spoke to Query PM on this ticket; if its still an issue the field team should bubble this up for us on engineering side to improve (i.e. Docs team isn't the solution here, if the meaning of things in our logs is an issue we should improve the logs message)

Comment by Emet Ozar [ 27/Oct/22 ]

daniel.coupal@mongodb.com Hey Daniel, just wanted to check in to see if this ticket is still relevant? Thank you, Emet CC: sarah.olson@mongodb.com ashley.brown@mongodb.com 

Generated at Thu Feb 08 07:51:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.