[SERVER-5266] Make a clearer API for configuring global slowms Created: 09/Mar/12 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Logging |
| Affects Version/s: | 2.0.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Jared D. Cottrell | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | logging, profiling, setParameter | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Assigned Teams: |
Query Optimization
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||
| Description |
|
Allow changing the threshold for logging slow queries. http://www.mongodb.org/display/DOCS/setParameter+Command |
| Comments |
| Comment by Asya Kamsky [ 07/Sep/18 ] | |||||||||||||||
|
You can set slowMs globally via
This may not have worked in the past but works currently. 0 as first parameter indicates that no profiling should be done, and ms threshold can be specified as 0 or even -1 to log all operations. Example:
To see current slowms setting use
| |||||||||||||||
| Comment by Asya Kamsky [ 24/Jan/18 ] | |||||||||||||||
|
We would like to make changes in SERVER-4785 to allow setting profiling for one DB only, so re-opening this ticket to track setting global slowms threshold. | |||||||||||||||
| Comment by Mike Zraly [ 23/Mar/17 ] | |||||||||||||||
|
Well shoot, I was hoping to be able to simplify provisioning of test environments by specifying the threshold in the mongod.conf file so that I can use the canned init.d service scripts. Thanks for getting back to me. | |||||||||||||||
| Comment by Mira Carey [ 23/Mar/17 ] | |||||||||||||||
|
It's possible to set the slowms threshold in a running server by issuing profile commands. These can be issued either with db.setProfilingLevel, or by manually running the command. The below samples will alter slowms without changing the profiling level
While a setParameter would be more in line with current database features, we consider the current functionality sufficient. | |||||||||||||||
| Comment by Scott Hernandez (Inactive) [ 09/Mar/12 ] | |||||||||||||||
|
Currently slowms is global and can be set using a pattern like this:
|