Skip to content

fix: reduce high CPU usage - #2

Open
sasharozenson wants to merge 1 commit into
natesales:mainfrom
sasharozenson:improvement/reduce-cpu-usage
Open

fix: reduce high CPU usage#2
sasharozenson wants to merge 1 commit into
natesales:mainfrom
sasharozenson:improvement/reduce-cpu-usage

Conversation

@sasharozenson

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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.

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

Successfully merging this pull request may close these issues.

2 participants