[SERVER-4785] slowms should be per database for profiler Created: 26/Jan/12  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Performance
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 2
Labels: profiling, query-44-grooming, stats
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-5266 Make a clearer API for configuring gl... Backlog
Related
related to SERVER-11125 setProfilingLevel() does not accept z... Closed
related to SERVER-4786 Random sampling for profiling and log... Closed
is related to SERVER-18946 I wish I can configure separately the... Open
Assigned Teams:
Query Optimization
Participants:
Case:

 Description   

The slowms constant is not per database but is process wide.

> db.setProfilingLevel(1,1000)
{ "was" : 0, "slowms" : 100, "ok" : 1 }
> db.getProfilingStatus()
{ "was" : 1, "slowms" : 1000 }
> use test2
switched to db test2
> db.setProfilingLevel(1,2)
{ "was" : 0, "slowms" : 1000, "ok" : 1 }
> db.getProfilingStatus()
{ "was" : 1, "slowms" : 2 }
> use test
switched to db test
> db.getProfilingStatus()
{ "was" : 1, "slowms" : 2 }

Notice how slowms went to 2 in the test database... That is not good.



 Comments   
Comment by Asya Kamsky [ 24/Jan/18 ]

Since slowms applies to profiling as well as logging, should per-db change also apply to both or to profiling only?

Comment by Asya Kamsky [ 24/Jan/18 ]

Open questions that aren't clear and need to be clarified before implementation for this ticket can be completed (as well as for any ticket dealing with logging operations on mongos).

Does the "db-only" flag apply to slowms and sampleRate?

What if global setting is later changed, does the global setting override earlier set DB only setting?

Or should the most "verbose" setting apply between global and per-db?

Comment by Asya Kamsky [ 02/Jan/18 ]

SERVER-5266 was closed won't fix but if the syntax of db.setProfilingLevel is changed to only affect a single database there will be requirement to have syntax to set globally what slowms is (without having to restart mongod with new slowms setting).

Note that this change as proposed is backwards breaking to every instruction given by our support which is currently assumed to have global effect.

Recommend we consider non-backwards breaking syntax, like db.setProfilingLevel(0,1,false) where last parameter is "applyGlobally" and by default is true. (or applyToCurrentDB only and by default is false).

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