-
Notifications
You must be signed in to change notification settings - Fork 6
hsbeat cause io wait high ! #2
Comments
Thank you for reporting! I've fixed performance issue of file access: However, we might encounter performance issue. It might be improved with index structure in ES. |
I improved performance of HSBeat than before: I've attached CPU profile callgraph of it.
This profile shows that top overhead is GC routine. It is too difficult to improve more performance. |
Thanks |
I guess that high CPU usage is caused by Go runtime. diff --git a/hsbeat/hsbeat.go b/hsbeat/hsbeat.go
index 4dede96..c2a5632 100644
--- a/hsbeat/hsbeat.go
+++ b/hsbeat/hsbeat.go
@@ -135,18 +135,22 @@ func (this *HSBeat) publishCached(b *beat.Beat) error {
}
func (this *HSBeat) Run(b *beat.Beat) error {
+/*
err := this.publishAll(b)
if err != nil {
return err
}
+*/
for !this.ShouldTerminate {
time.Sleep(this.Interval)
+/*
err := this.publishCached(b)
if err != nil {
return err
}
+*/
}
diff --git a/main.go b/main.go
index f2d0c83..3912898 100644
--- a/main.go
+++ b/main.go
@@ -28,7 +28,7 @@ import (
hsbeat "github.com/YaSuenag/hsbeat/hsbeat"
- //"runtime/pprof"
+ "runtime/pprof"
)
@@ -38,14 +38,18 @@ func main() {
log.Fatal(err)
}
-/*
- prof, err := os.Create("hsbeat.prof")
+ prof, err := os.Create("hsbeat.pprof")
if err != nil {
log.Fatal(err)
}
pprof.StartCPUProfile(prof)
defer pprof.StopCPUProfile()
-*/
+
+ mprof, err := os.Create("hsbeat.mprof")
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer pprof.WriteHeapProfile(mprof)
hb :=&hsbeat.HSBeat{os.Args[1], time.Duration(interval), "",
false, nil, nil, nil} I applied above patch (this patch makes empty loop in Beat), but I saw high CPU usage. CPU profiling shows futex call is the most expensive in profiling session. Conclusion: |
@YaSuenag Which libbeat version are you currently using for hsbeat? |
@ruflin I use v1.0.0 (be66518) |
@YaSuenag I didn't check the issue in detail but in general it could help to upgrade the most recent version of libbeat. |
I fixed this issue in e02c891 ! So I will fix it soon in another commit. |
CPU usage in e02c891 is < 1% in my machine. Try it! |
It is correct. You can see data on Kibana dashboard if you import etc/kibana.json . |
Hi,I try to use the hsbeat collect the JVM info.
I found it cause the System TOP command CPU wa% from 1% to 70% even more!
My system is centos 6 and java version info is
openjdk version "1.8.0_65"
OpenJDK Runtime Environment (build 1.8.0_65-b17)
OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)
can we use the javaagent like hsflowd http://blog.sflow.com/2011/09/java-virtual-machine.html to monitor jvm performance ?
thanks
sorry for my bad english
The text was updated successfully, but these errors were encountered: