felixge / fgprof

🚀 fgprof is a sampling Go profiler that allows you to analyze On-CPU as well as Off-CPU (e.g. I/O) time together.
MIT License
2.81k stars 88 forks source link

problem on AWS EC2 #9

Closed shiyuleixia closed 3 years ago

shiyuleixia commented 3 years ago

This package can't work on AWS EC2. I use the gin web frame,when I send a request to my api,it just can‘t catch the calling-stack for this api

felixge commented 3 years ago

This is not a lot of information to understand your problem.

I'm guessing you did the following:

  1. Launch your application.
  2. Start a fgprof profile recording lasting 30s.
  3. Make a http request to your application.
  4. Wait for the profile to finish.
  5. Look at the profile and notice that your request handler function doesn't seem to appear.

If this is the case, the problem is most likely caused by your request handler executing too quickly for the profiler to catch it. Put a time.Sleep(time.Second) into your handler and see if this "fixes" your problem.

fgprof currently samples at 99 Hz, which means it will have a hard time detecting events lasting less than ~10ms.

If my understand of your problem is correct, I'm closing this issue because it would only be solvable with a much higher sampling rate which is at odds with the goal of low overhead profiling for now.