Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27162

instrument server code with high resolution CPU counter

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Current performance analysis tools such as vtune, linux perf do not allow to see how many cycles a predefined codepath takes.

      • gprof woudl be a good candidate but it does need to have modification in the source code to dump its output as server exists with call to _exit which will not execute atExit().
      • vtune and linux perf are good at analyzing lock contention and looking at statistically significant events. They are not good for answering a questions: how long (on average) does code path form point A to B runs in a given workload.
      • The proposal is to add a high res counter that can be used to instrument any code path to measure how many cycles it took and print the result in serverStatus output.
        Attached is a CR for a POC implementation that can be used as a starting point. In the provided example produces the output in the db.serverStatus:

        	"rdtsc tracer" : {
        		"Traced events for tag Find" : {
        			"HighRes Event #6" : " average: 4714900 , n: 2"
        		},
        		"Traced events for tag ConnS" : {
        			"HighRes Event #0" : " average: 109198 , n: 35"
        		}
        	},
        

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: