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

CPU usage spike with gosigar + metricbeat (process) on FreeBSD #38

Open
michbsd opened this issue Aug 2, 2016 · 8 comments
Open

CPU usage spike with gosigar + metricbeat (process) on FreeBSD #38

michbsd opened this issue Aug 2, 2016 · 8 comments

Comments

@michbsd
Copy link

michbsd commented Aug 2, 2016

Hi,

I running the latest build on metricbeat on FreeBSD 10.1-REL.
As soon as activating it, specifically the process metricset - the CPU usage spikes to 40-50%.

The metricbeat devs suggest that this might be an issue with gosigar.

Please have a look at the thread here:
https://discuss.elastic.co/t/metricbeat-on-freebsd-using-a-lot-of-resources/55412/20

There is also a link to a pprof trace.

This is my current gosigar revision:
61dfed4

Let me know if you need anything else.

Thanks,

@michbsd
Copy link
Author

michbsd commented Aug 16, 2016

Any news on this?

@ruflin
Copy link

ruflin commented Aug 17, 2016

@michbsd No updates so far from our side. Pinging @knz and @gregoryo2014 as they could also be active users of metricbeat on freebsd and it would be interesting if they have a similar problem?

@knz
Copy link

knz commented Aug 17, 2016

I've not seen this happening earlier. To me it looks as if the client code was polling the metrics too often. Since this code is going via /proc it will involve more machinery in the kernel than a simple sysctl/ioctl call.

@knz
Copy link

knz commented Aug 17, 2016

If you want to help you could first instrument / profile the code to see how often the API in gosigar is being invoked. If yous ee these usage spikes with a poll rate lower than one time per second, then there would be cause for concern.

@michbsd
Copy link
Author

michbsd commented Aug 19, 2016

@knz sure I can help with that. Can you point me to a guide / doc / tutorial on doing this?

thanks

@knz
Copy link

knz commented Aug 19, 2016

print time.Time() at the beginning of every relevant function. Then look in the output of your program which times are being printed and how much time elapses between each print.

@michbsd
Copy link
Author

michbsd commented Aug 19, 2016

@knz right - to I add this to all "process" related functions in metricbeats - print e.g function-name + time ?

@knz
Copy link

knz commented Aug 19, 2016

for example yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants