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

instrument server code with high resolution CPU counter

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Product Performance
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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"
        		}
        	},
        

            Assignee:
            backlog-server-perf [DO NOT USE] Backlog - Performance Team
            Reporter:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: