The procstat plugin is too expensive to run on Linux. The issue becomes worse when needing to run several instances and when the system has more processes.
Relevant telegraf.conf:
[[inputs.procstat]]
exe = ".*"
System info:
1.14.3
Steps to reproduce:
run telegraf with procstat plugin
Expected behavior:
Use less system resources
Actual behavior:
Too much cpu use and memory allocations
Additional info:
$ go test -short ./plugins/inputs/procstat/... -bench=. -benchmem
goos: linux
goarch: amd64
pkg: github.com/influxdata/telegraf/plugins/inputs/procstat
BenchmarkPattern-4 13 82058380 ns/op 22489259 B/op 236393 allocs/op
BenchmarkFullPattern-4 13 82729865 ns/op 23000728 B/op 237198 allocs/op
PASS
ok github.com/influxdata/telegraf/plugins/inputs/procstat 3.238s
flame graph
![image](https://user-images.githubusercontent.com/17263167/89929285-e675c080-dbbd-11ea-8bc1-b45be42949fd.png)
method list
![image](https://user-images.githubusercontent.com/17263167/89929202-c47c3e00-dbbd-11ea-9afc-cf6e6a586e6f.png)
call tree
![image](https://user-images.githubusercontent.com/17263167/89929609-4704fd80-dbbe-11ea-9eb4-ad308a8aaca1.png)
The procstat plugin is too expensive to run on Linux. The issue becomes worse when needing to run several instances and when the system has more processes.
Relevant telegraf.conf:
System info:
1.14.3
Steps to reproduce:
Expected behavior:
Use less system resources
Actual behavior:
Too much cpu use and memory allocations
Additional info: