[SERVER-4786] Random sampling for profiling and logging Created: 26/Jan/12 Updated: 15/May/18 Resolved: 27/Jan/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.3 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Scott Hernandez (Inactive) | Assignee: | David Storch |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng, profiling | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Sprint: | Query 2017-02-13 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
Add a new sampleRate parameter to the profile command. This parameter can take values on the interval [0, 1], and is set to 1 by default on startup. The behavior of sampleRate is as follows for logging:
For creating system.profile entries, the behavior of sampleRate is as follows:
There are three ways to set the profiler sampleRate. The first is by running the profile command. For example, the following command indicates that the server should profile 10% of operations slower than 30ms:
This command will return the previous settings of profile, slowms, and sampleRate on success. Like slowms, the sampleRate setting is unchanged when it is omitted from the command. The sampleRate can also be set from the shell using the db.setProfilingLevel() helper:
The second argument to this helper is now either the slowms value, or an options object. The second way to set sampleRate is the new slowOpSampleRate command line option:
Third, it can be set in a configuration file using operationProfiling.slowOpSampleRate. |
| Comments |
| Comment by Githook User [ 27/Jan/17 ] | |
|
Author: {u'username': u'evan-stripe', u'name': u'Evan Broder', u'email': u'evan@stripe.com'}Message: Adds a sampleRate parameter to the profile command, a value Closes #1099 Signed-off-by: David Storch <david.storch@10gen.com> | |
| Comment by Richard Kreuter (Inactive) [ 17/Jun/14 ] | |
|
If this is to be done, it would be good for the sampling frequency to be tunable. Spitball proposal: when the profiling level is 3, allow the user to submit a double float, with 1.0 meaning "profile everything" and 0.0 meaning profile nothing. A sampling frequency of 1/500 would thus be equivalent to:
|