Pyroscope is a program performance analysis platform written in pure GO language, which supports viewing the call relationship and CPU usage between programs, and uses charts and call trees to find performance problems in the code.
Peculiarity:
You can save the historical data of multiple apps
Data analysis granularity can be customized (10 seconds to years)
The CPU overhead is low, and the disk space requirements are not high
The user interface is comfortable and simple
Quick use (Ubuntu environment as an example):
1. Download the package
wget https://dl.pyroscope.io/release/pyroscope_0.0.37_amd64.deb
2. Installation
sudo apt-get install ./pyroscope_0.0.37_amd64.deb
3. Start the service
sudo systemctl start pyroscope-serversudo systemctl enable pyroscope-server
4. Analysis program (take GO program as an example)
package mainimport "github.com/pyroscope-io/pyroscope/pkg/agent/profiler"func main() {profiler.Start(profiler.Config{ApplicationName: "simple.golang.app",// pyroscope服务器地址ServerAddress: "http://pyroscope-server:4040",// 选择需要使用的分析器,默认全部开启ProfileTypes: []profiler.ProfileType{profiler.ProfileCPU,profiler.ProfileAllocObjects,profiler.ProfileAllocSpace,profiler.ProfileInuseObjects,profiler.ProfileInuseSpace,},})//你的代码放在这里}
5. Check the analysis on the http://localhost:4040/
Pyroscope currently supports Ruby, Python, Go, Linux eBPF, PHP and .NET analysis, the JAVA version is under development, and the project has been maintained, and more features will be added in the future, interested students can learn about it.