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

Polling times can be slightly inconsistent #3101

Closed
lbsou opened this issue Nov 22, 2019 · 8 comments
Closed

Polling times can be slightly inconsistent #3101

lbsou opened this issue Nov 22, 2019 · 8 comments
Labels
bug Undesired behaviour resolved A fixed issue

Comments

@lbsou
Copy link

lbsou commented Nov 22, 2019

Hi!

This morning, I posted a spine issue, but since then, I realised it was probably more a poller.php bug.

Cacti/spine#123

Hi!

Describe the bug

Just installed a brand new cacti. I added all my devices (1400+) and it is now polling.

It is configured to poll every 10seconds with poller.php called every minute by crontab.

/etc/cron.d/cacti
*/1 * * * * root php /usr/share/cacti-1.2.7/poller.php > /dev/null 2>&1

image

The problem is that instead of the 10seconds intervals, it happen in 8 seconds and sleep at the end of the 6 polling sequence. (see screenshot)

To Reproduce
Configure same parameter as I did I suppose...

Expected behavior
As you can see in my other screenshot of my current production server, the interval are 10seconds.

Screenshots

image

For comparison, here is the CPU stats from my other server 0.8.8g

image

Server (please complete the following information):
Cacti 1.2.7
Spine 1.2.7
RedHat 8.1
PHP 7.3.12

Compiling (please complete the following information):

@bmfmancini
Copy link
Member

Sounds like something on RHEL more than on spine since cron would be the mechanisim that would initiate spine

try this create a small script that echos the time to a text file and have it run at the same time restart the crond service to be sure it syncs up and compare if the echo and spine behave the same

@lbsou
Copy link
Author

lbsou commented Nov 26, 2019

/var/log/cron show that poller.php is launch by crontab exactly every minutes.

And as you can see in the screenshot, poller.php launch spine every... 8 seconds or so.

@TheWitness
Copy link
Member

Man, 10 seconds with 1400 devices. Must be a big box. I would suggest that this is a small issue in poller.php.

@TheWitness
Copy link
Member

Hmm, seems a counter issue inside of poller.php. It should record the start time, and the end time, take the difference between that and the start of the next poll, and then sleep for that amount of time.

@TheWitness TheWitness added the bug Undesired behaviour label Nov 26, 2019
@lbsou
Copy link
Author

lbsou commented Nov 26, 2019

Ok, that's what I tought.

FYI, running on a 20 x XeonE7-4850 v4 @ 2.10GHz
@+!

@TheWitness
Copy link
Member

Yea, that's a beast.

cigamit added a commit that referenced this issue Nov 27, 2019
Poller.php polling... too fast?!
@cigamit cigamit added the resolved A fixed issue label Nov 27, 2019
@cigamit
Copy link
Member

cigamit commented Nov 27, 2019

Update your poller.php from branch 1.2.x and report back.

@lbsou
Copy link
Author

lbsou commented Nov 27, 2019

Yep, back to normal!
image

Thank you!

@lbsou lbsou closed this as completed Nov 27, 2019
@netniV netniV changed the title Poller.php polling... too fast?! Polling times can be slightly inconsistent due Dec 7, 2019
@netniV netniV changed the title Polling times can be slightly inconsistent due Polling times can be slightly inconsistent Feb 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants