Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: reduce high CPU usage #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sasharozenson
Copy link

Fixed high CPU usage caused by a busy-wait loop reading lines from a JSONL file without delay. This loop was consuming up to 500% CPU by keeping it constantly occupied.

Fixed high CPU usage caused by a busy-wait loop reading lines from a JSONL file without delay. This loop was consuming up to 500% CPU by keeping it constantly occupied.
@abower-amd
Copy link

Hi @sasharozenson and many thanks @natesales for preparing this exporter - it looks like it has been useful to users!

You may be interested to know that sfptpd on github now has a built-in OpenMetrics stats exporter. The basic functionality is modelled on sfptpd-exporter but is extended in various ways and there are some slight changes to the metrics definitions which we thought were necessary. Please do take a look, give it a try and let us know if you have any suggestions for changes.

@sasharozenson
Copy link
Author

Hi @abower-amd,
Oh, this is amazing - I’ll check it out soon! Coincidentally, I was just brainstorming an issue I’ve noticed with the current exporter: when the network restarts, it exports duplicate servos. This breaks the logic for identifying the system clock servo and triggers alerts in my setup. I guess I’ll start by checking the new solution before making further modifications to the current one. Thanks!

@abower-amd
Copy link

Oh, this is amazing - I’ll check it out soon! Coincidentally, I was just brainstorming an issue I’ve noticed with the current exporter: when the network restarts, it exports duplicate servos. This breaks the logic for identifying the system clock servo and triggers alerts in my setup. I guess I’ll start by checking the new solution before making further modifications to the current one. Thanks!

Great - look forward to hearing how you get on!

You might well find you have similar issues with the built-in version - it's based on the same stats log data. The built-in version currently doesn't add extra labels with some of the details available in the logs and the Go exporter - we can add them in if they are useful! It's easy to add at this stage and better than doing it after the first release!

@abower-amd
Copy link

I would also add that there is nothing stopping you running both exporters simultaneously - the RT stats are copied into a circular buffer for export but can still be written out to file as well.

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

Successfully merging this pull request may close these issues.

2 participants