开发者

Profiling network software / Profiling software with lot of system call waiting

开发者 https://www.devze.com 2023-03-11 09:34 出处:网络
I\'m working on a complex network software and I have trouble determining how to improve the systems performance.

I'm working on a complex network software and I have trouble determining how to improve the systems performance.

Specifically in one part of the software which is using blocking synchronous calls. 开发者_如何学GoSince this part of the system is doing heavy computations it's nearly impossible to determine whether the slowness of this component is caused by these computations or the waiting for the other parts of the system.

Are there any light-weight profilers that can capture this information? I can't use heavy duty profile like valgrind since that would completely skew the results (although valgrind would be perfect, since it captures all the required information).

I tried using oProfile but I just wasn't able to get any meaningful results out of it (perhaps if there is a concise tutorial somewhere...).


What you need is something that gives you stack samples, on wall-clock time (not just CPU time like gprof), and reports by line (not just by function) the percent of samples containing the line.

Zoom will do it, but I just do random-pausing. Here's why it works. Here's a blow-by-blow example. Here's another explanation.


Comment out your "heavy computations" and see if it's still slow. That will tell you if it's waiting on other systems over the network or the computations. The answer may not be either/or and may just be an accumulation of things.


You could also do some old fashioned printf debugging and print the time before and after executing the function to standard output or syslog. That is about as light-weight as profiling gets.

0

精彩评论

暂无评论...
验证码 换一张
取 消