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

enable google perftools, e.g. heap profiler, cpu profiler, to work

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Incomplete
    • Affects Version/s: 2.2.0-rc0
    • Fix Version/s: None
    • Component/s: Internal Code

      Description

      After we changed all the exit()'s to _exit()'s, this broke the way google perf tools work, since they register an exit handler to write out the profiler data. This would be easy to fix; just add conditional compilation to call ::exit instead of ::_exit when using --use-cpu-profiler SCons flag. Unfortunately, it means that we can't easily ask users to turn on heap profiling just via environment variables, like we could with 2.0.7.

      I'm not sure if calling ProfilerStop() explicitly writes out the profile right then or if it waits until process exit.

        Activity

        Hide
        eliot Eliot Horowitz added a comment -

        Not 100% sure we should backport, but should certainly consider it.

        Show
        eliot Eliot Horowitz added a comment - Not 100% sure we should backport, but should certainly consider it.
        Hide
        mdcallag Mark Callaghan added a comment - - edited

        On my x86_64 (Ubuntu 13.10) I don't get useful output in the gperftools profiler output file unless I add a call to ProfilerRegisterThread to handleIncomingMsg(). See https://code.google.com/p/gperftools/issues/detail?id=335. I want hierarchical profiling to help explain a perf regression in MongoDB 2.6 compared to 2.4 – https://jira.mongodb.org/browse/SERVER-13663

        I asked about this at https://groups.google.com/forum/#!topic/google-perftools/gEpE7_AdibI

        Show
        mdcallag Mark Callaghan added a comment - - edited On my x86_64 (Ubuntu 13.10) I don't get useful output in the gperftools profiler output file unless I add a call to ProfilerRegisterThread to handleIncomingMsg(). See https://code.google.com/p/gperftools/issues/detail?id=335 . I want hierarchical profiling to help explain a perf regression in MongoDB 2.6 compared to 2.4 – https://jira.mongodb.org/browse/SERVER-13663 I asked about this at https://groups.google.com/forum/#!topic/google-perftools/gEpE7_AdibI
        Hide
        schwerin Andy Schwerin added a comment -

        Interesting. Last time I used the tool was on Ubuntu 12.04LTS, back in March, and I did not experience this behavior. Mark Callaghan, can you file a separate SERVER issue for this? Was the error behavior you saw that only the main() thread was showing up in the profiles? If you can, please attach an erroneous and correct profile to the ticket, too (as an SVG would be best).

        Show
        schwerin Andy Schwerin added a comment - Interesting. Last time I used the tool was on Ubuntu 12.04LTS, back in March, and I did not experience this behavior. Mark Callaghan , can you file a separate SERVER issue for this? Was the error behavior you saw that only the main() thread was showing up in the profiles? If you can, please attach an erroneous and correct profile to the ticket, too (as an SVG would be best).
        Hide
        mdcallag Mark Callaghan added a comment -

        gperftool maintainer says this might be a new problem
        created https://jira.mongodb.org/browse/SERVER-13683

        Show
        mdcallag Mark Callaghan added a comment - gperftool maintainer says this might be a new problem created https://jira.mongodb.org/browse/SERVER-13683
        Hide
        milkie Eric Milkie added a comment -

        Yes, I agree.

        Show
        milkie Eric Milkie added a comment - Yes, I agree.

          People

          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: