Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procstat input with exe or pattern options are slow on Linux #7642

Closed
danielnelson opened this issue Jun 6, 2020 · 4 comments
Closed

Procstat input with exe or pattern options are slow on Linux #7642

danielnelson opened this issue Jun 6, 2020 · 4 comments
Assignees
Labels
area/procstat performance problems with decreased performance or enhancements that improve performance

Comments

@danielnelson
Copy link
Contributor

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:

  1. 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
@danielnelson danielnelson added performance problems with decreased performance or enhancements that improve performance area/procstat labels Jun 6, 2020
@danielnelson danielnelson added this to the Planned milestone Jun 6, 2020
@danielnelson
Copy link
Contributor Author

related shirou/gopsutil#842

@jsteenb2
Copy link
Contributor

jsteenb2 commented Aug 11, 2020

additional benchmark memory context:

flame graph

image

method list

image

call tree

image

@ssoroka
Copy link
Contributor

ssoroka commented Aug 19, 2020

related to #7884

@jessingrass
Copy link
Contributor

should be resolved by #7884

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/procstat performance problems with decreased performance or enhancements that improve performance
Projects
None yet
Development

No branches or pull requests

4 participants