I am looking for a simple explanation of how gperftools works. So far, this is what I have learned:
- It runs a stop-the-world sampler. In other words, it periodically stops the program being profiled to collect information.
- Golang's pprof library uses gperftools underneath.
Besides a general overview, here are some specific questions I would like answered:
- Is gperftools an "event based profiler" or "instrumentation profiler". From what I understand, these profilers modify the way a program runs and collect samples via those modifications
- At what 'level' in the OS does gperftools profile? Does it profile the kernal like SystemTap or perf?
- Is gperftools safe to run on a high-traffic production server?
I am asking this question to reason about the overhead introduced by using pprof on a Go server.