Giter VIP home page Giter VIP logo

Comments (12)

SovereignRemedy avatar SovereignRemedy commented on July 18, 2024 1

GCHeap.heap-3.20230131112906.390.log mem.20230131112506.312.log 提供两个dumpdump出来的文件 如果需要别的可以再提供

两个profile里的metric指向的函数都是,应该是add2line的时候找不到函数名和地址。能提供下demo吗

因为是公司的服务感觉不太好直接全贴出来..需要哪些关键的地方我可以节选出来。 ` func systemInit() { err := service.Init() if err != nil { glog.Fatalf("system fatal err:%s", err) } configs.InitDb() appstore.Init() appdev.Init() //authcheck.Init()

r := &ReporterImpl{}
h, _ := holmes.New(
	holmes.WithProfileReporter(r),
	holmes.WithCollectInterval("5s"),
	holmes.WithDumpPath("/tmp"),
	holmes.WithTextDump(),

	holmes.WithCPUDump(10, 25, 80, time.Minute),
	holmes.WithMemDump(30, 25, 80, time.Minute),
	holmes.WithGCHeapDump(10, 20, 40, time.Minute),
	holmes.WithGoroutineDump(500, 25, 20000, 0, time.Minute),
	holmes.WithCGroup(true), // set cgroup to true
)

h.EnableCPUDump().
	EnableGoroutineDump().
	EnableMemDump().
	EnableGCHeapDump().Start()

}
type ReporterImpl struct{}
func (r *ReporterImpl) Report(pType string, filename string, reason holmes.ReasonType, eventID string, sampleTime time.Time, pprofBytes []byte, scene holmes.Scene) error { // do something glog.Infof("report to minio reporter %s", filename) fr := bytes.NewReader(pprofBytes) minioClient := configs.Get().MinioClientPool.Get() _, err := minioClient.PutObject(context.Background(), configs.Get().DownloadBucket, filepath.Join("wxtest", filename), fr, int64(len(pprofBytes)), minio.PutObjectOptions{ContentType: pType}) if err != nil { glog.Errorf("Reporter holmes.Report error %v", err) } return err }
func main() { systemInit() //appdev.Get().TestPublish("./data/com.liuli.app-store.tar") //service.Get().Run() for true { time.Sleep(1 * time.Minute) } }
`
这部分就是集成holmes的地方 剩下就是请求一个文件上传的业务接口

你方便运行下 这里的case吗?看看能否正常解析。 我想排除是不是项目依赖的第三库导
致的问题,有些库会对runtime分配下来的资源进行二次分配,给profile增加了很多噪音,比如goid。

本地运行demo可以正常解析。
运行自己的服务确实仍然会出现上述问题。
mem.20230201183949.552.log
go.mod.txt

from holmes.

Jun10ng avatar Jun10ng commented on July 18, 2024

这个和文件后缀应该没啥关系,只要是生成的压缩文件的内容符合谷歌pprof pb格式的要求,就可以被 go pprof工具正常解析。

我起了个demo,import了holmes的master分支代码。并没有复现你的问题。

方便提供一下可复现的case吗,我们在一起调查下。

from holmes.

SovereignRemedy avatar SovereignRemedy commented on July 18, 2024

GCHeap.heap-3.20230131112906.390.log
mem.20230131112506.312.log
提供两个dumpdump出来的文件 如果需要别的可以再提供

from holmes.

Jun10ng avatar Jun10ng commented on July 18, 2024

GCHeap.heap-3.20230131112906.390.log mem.20230131112506.312.log 提供两个dumpdump出来的文件 如果需要别的可以再提供

两个profile里的metric指向的函数都是,应该是add2line的时候找不到函数名和地址。能提供下demo吗

from holmes.

SovereignRemedy avatar SovereignRemedy commented on July 18, 2024

GCHeap.heap-3.20230131112906.390.log mem.20230131112506.312.log 提供两个dumpdump出来的文件 如果需要别的可以再提供

两个profile里的metric指向的函数都是,应该是add2line的时候找不到函数名和地址。能提供下demo吗

因为是公司的服务感觉不太好直接全贴出来..需要哪些关键的地方我可以节选出来。
`
func systemInit() {
err := service.Init()
if err != nil {
glog.Fatalf("system fatal err:%s", err)
}
configs.InitDb()
appstore.Init()
appdev.Init()
//authcheck.Init()

r := &ReporterImpl{}
h, _ := holmes.New(
	holmes.WithProfileReporter(r),
	holmes.WithCollectInterval("5s"),
	holmes.WithDumpPath("/tmp"),
	holmes.WithTextDump(),

	holmes.WithCPUDump(10, 25, 80, time.Minute),
	holmes.WithMemDump(30, 25, 80, time.Minute),
	holmes.WithGCHeapDump(10, 20, 40, time.Minute),
	holmes.WithGoroutineDump(500, 25, 20000, 0, time.Minute),
	holmes.WithCGroup(true), // set cgroup to true
)

h.EnableCPUDump().
	EnableGoroutineDump().
	EnableMemDump().
	EnableGCHeapDump().Start()

}

type ReporterImpl struct{}

func (r *ReporterImpl) Report(pType string, filename string, reason holmes.ReasonType, eventID string, sampleTime time.Time, pprofBytes []byte, scene holmes.Scene) error {
// do something
glog.Infof("report to minio reporter %s", filename)
fr := bytes.NewReader(pprofBytes)
minioClient := configs.Get().MinioClientPool.Get()
_, err := minioClient.PutObject(context.Background(),
configs.Get().DownloadBucket, filepath.Join("wxtest", filename),
fr, int64(len(pprofBytes)), minio.PutObjectOptions{ContentType: pType})
if err != nil {
glog.Errorf("Reporter holmes.Report error %v", err)
}
return err
}

func main() {
systemInit()
//appdev.Get().TestPublish("./data/com.liuli.app-store.tar")
//service.Get().Run()
for true {
time.Sleep(1 * time.Minute)
}
}

`

这部分就是集成holmes的地方 剩下就是请求一个文件上传的业务接口

from holmes.

Jun10ng avatar Jun10ng commented on July 18, 2024

GCHeap.heap-3.20230131112906.390.log mem.20230131112506.312.log 提供两个dumpdump出来的文件 如果需要别的可以再提供

两个profile里的metric指向的函数都是,应该是add2line的时候找不到函数名和地址。能提供下demo吗

因为是公司的服务感觉不太好直接全贴出来..需要哪些关键的地方我可以节选出来。 ` func systemInit() { err := service.Init() if err != nil { glog.Fatalf("system fatal err:%s", err) } configs.InitDb() appstore.Init() appdev.Init() //authcheck.Init()

r := &ReporterImpl{}
h, _ := holmes.New(
	holmes.WithProfileReporter(r),
	holmes.WithCollectInterval("5s"),
	holmes.WithDumpPath("/tmp"),
	holmes.WithTextDump(),

	holmes.WithCPUDump(10, 25, 80, time.Minute),
	holmes.WithMemDump(30, 25, 80, time.Minute),
	holmes.WithGCHeapDump(10, 20, 40, time.Minute),
	holmes.WithGoroutineDump(500, 25, 20000, 0, time.Minute),
	holmes.WithCGroup(true), // set cgroup to true
)

h.EnableCPUDump().
	EnableGoroutineDump().
	EnableMemDump().
	EnableGCHeapDump().Start()

}

type ReporterImpl struct{}

func (r *ReporterImpl) Report(pType string, filename string, reason holmes.ReasonType, eventID string, sampleTime time.Time, pprofBytes []byte, scene holmes.Scene) error { // do something glog.Infof("report to minio reporter %s", filename) fr := bytes.NewReader(pprofBytes) minioClient := configs.Get().MinioClientPool.Get() _, err := minioClient.PutObject(context.Background(), configs.Get().DownloadBucket, filepath.Join("wxtest", filename), fr, int64(len(pprofBytes)), minio.PutObjectOptions{ContentType: pType}) if err != nil { glog.Errorf("Reporter holmes.Report error %v", err) } return err }

func main() { systemInit() //appdev.Get().TestPublish("./data/com.liuli.app-store.tar") //service.Get().Run() for true { time.Sleep(1 * time.Minute) } }

`

这部分就是集成holmes的地方 剩下就是请求一个文件上传的业务接口

你方便运行下 这里的case吗?看看能否正常解析。
我想排除是不是项目依赖的第三库导致的问题,有些库会对runtime分配下来的资源进行二次分配,给profile增加了很多噪音,比如goid。

from holmes.

Jun10ng avatar Jun10ng commented on July 18, 2024

/needInvestigate

from holmes.

z760087139 avatar z760087139 commented on July 18, 2024

环境
rancher v2.4.4
holmes v1.1.0

holmes.WithTextDump(),
holmes.WIthMemDump(20,50,70,5*time.Minute)

导出的 heap 会出现 unknown 的情况

from holmes.

doujiang24 avatar doujiang24 commented on July 18, 2024

@z760087139

  1. 最好单独搞个 issue,看起来不是同一个问题

  2. 导出的 heap 会出现 unknown 的情况

    这个具体是什么情况呢?文件内容是 unknown 么?

from holmes.

z760087139 avatar z760087139 commented on July 18, 2024

@z760087139

  1. 最好单独搞个 issue,看起来不是同一个问题

  2. 导出的 heap 会出现 unknown 的情况

    这个具体是什么情况呢?文件内容是 unknown 么?

与 issue 截图的内容一样,heap 内容能够被 profile 工具解读,但是指向 unknown。
不过因为公司使用的内网无法把 profile 拿出来展示,我只是想提供一个曾经复现的场景

from holmes.

vurihuang avatar vurihuang commented on July 18, 2024

使用的是官方的 Deadlock 例子,复现了相同的场景,其他的 demo 也有相同的问题。

Deadlock Demo 包含了 debug log, profile, etc..
image

from holmes.

vurihuang avatar vurihuang commented on July 18, 2024

golang/go#26255

from holmes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.