[SERVER-14900] log slow queries on mongos Created: 14/Aug/14  Updated: 17/Mar/20  Resolved: 22/Mar/18

Status: Closed
Project: Core Server
Component/s: Diagnostics, Querying, Sharding
Affects Version/s: 2.4.10
Fix Version/s: 3.7.4

Type: Improvement Priority: Major - P3
Reporter: Alexander Komyagin Assignee: Bernard Gorman
Resolution: Done Votes: 8
Labels: SWDI
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Duplicate
is duplicated by SERVER-33939 Improve logging in sharded clusters t... Closed
is duplicated by SERVER-2926 mongos should log slow queries Closed
Related
related to SERVER-34208 findAndModify should record update st... Backlog
related to SERVER-1957 implement profile for mongos Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.6, v3.4
Sprint: Query 2018-02-26, Query 2018-03-12, Query 2018-03-26
Participants:
Case:

 Description   

mongos should print out slow queries just like mongod does to assist in bottlenecks and slownesses diagnosis



 Comments   
Comment by Githook User [ 24/Mar/18 ]

Author:

{'email': 'bernard.gorman@gmail.com', 'name': 'Bernard Gorman', 'username': 'gormanb'}

Message: SERVER-14900 Ensure that operations are logged under the correct component
Branch: master
https://github.com/mongodb/mongo/commit/78a7801eb0f6e102895b83fbb544eb1d2c5220b8

Comment by Githook User [ 24/Mar/18 ]

Author:

{'email': 'bernard.gorman@gmail.com', 'name': 'Bernard Gorman', 'username': 'gormanb'}

Message: SERVER-14900 Record post-execution CurOp metrics on mongoS
Branch: master
https://github.com/mongodb/mongo/commit/6e693c8e92b62bf441d3f07fad1585d030c20cec

Comment by Githook User [ 22/Mar/18 ]

Author:

{'email': 'bernard.gorman@gmail.com', 'name': 'Bernard Gorman', 'username': 'gormanb'}

Message: SERVER-14900 Log operations that exceed slowMs on mongoS
Branch: master
https://github.com/mongodb/mongo/commit/40d59f4bc8eec0fc585edec0f2c8833f09a4a853

Comment by Benoit Labergri [ 29/Aug/16 ]

Hello,
Indeed it would be a good thing to have that for investigation purpose. When we have a slow query we want to know which shard was slow. Trying to find which of our 48 shards is the guilty before trying to understand why is a lost of time.
And from time to time we don't see anything on the shards, it can be the network but also linked to the config servers (reload of config) and probably other steps in mongos.
So having a verbosity in mongos would allow to detect at least who is the root cause of the response time issue we can encounter like for the ticket https://jira.mongodb.org/browse/CS-28261 on which it has been difficult and still difficult to check the origin.
Could you please at least detect the slow query and log in MONGOS logs the time of each external calls of mongos (shard and config) ?

NB: it affect all version of mongo
Thank
Benoit LABERGRI

Generated at Thu Feb 08 03:36:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.