Closed infa-ddeore closed 6 years ago
@infa-ddeore Thanks for opening this up as your first issue, Welcome to Github!
I will submit a PR for this shortly.
@infa-ddeore did you find that 5
was a reasonable number on your hardware profile? The more constrained the resources are the more impact the poll interval (sleep) will have. On my local machine I noticed very little difference because I have plenty of CPU and memory but when I last did that testing I was testing it based on an aws vm (m4.large) if I recall correctly. I think its worth exploring if there might be a better default than 5
. From my tests so far it looks pretty close to top usage at 5
, at worst its been inflated by maybe as much as 2-3 percent which I'd say is pretty negligable. Also keep in mind I have lots of things running on my local machine and pretty much anything could cause a 2-3% variation between captures. I have been comparing the results to top -d 5
to make sure that we are not comparing apples and oranges.
I have opened a pull request looking to change the default, can you share any information on how much of an improvement 5 seconds is for you and if you found some other number that seemed to be better for you?
I have asked the concerned team to use --sleep 5
so I can confirm only after they see the improvement.
But as a default I am setting up 5 seconds delay for the instances that I own.
@infa-ddeore have you heard back from that team if that helped?
they added this option just today, since the issue is intermittent we need to monitor for few days. I will update after few days (about 6-7)
there has not been any false cpu alert so far after adding 5 seconds of sleep
Should we give a warning in README about not having interval less than sleep, since sleep default is 5 seconds now
I was thinking about that, I think its OK as is. It's called out clearly in the changelog and realistically if someone wants to schedule it more frequently than every 10 seconds they are probably ok with opening the code or the changelog. I would not oppose a PR to add some blurb about it though.
check-cpu.rb alerts sometimes with total cpu being 100% busy, but the top output captured at the same time as a part of
hooks
doesn't show any load.Explanation by @majormoses:
Change default 1 seconds to something higher to get more accurate data and avoid un-necessary alerts.