Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

100% cpu usage on freebsd #130

Open
knz opened this issue Aug 30, 2020 · 2 comments
Open

100% cpu usage on freebsd #130

knz opened this issue Aug 30, 2020 · 2 comments

Comments

@knz
Copy link

knz commented Aug 30, 2020

Just installed from source since the OVH freebsd pkg archive doesn't deliver Freebsd 12 binaries yet.

The beamium binary is using 100% CPU.

Debugger reveals that the main loop in main.rs never sleeps: let watch_event_count = watcher_rx.try_iter().count(); completes immediately if there are no events, and the rest of the loop body doesn't do anything when there are no events.

Hence the busy-loop.

Adding a thread::sleep at the end of that loop seems to alleviate the issue.

@GregOriol
Copy link

GregOriol commented Dec 4, 2020

Not sure it is the same, but we also have a case of one instance running at 100% CPU on ubuntu 20.04, but in our case we found out it was because the folder /opt/beamium/sources/ had a huge number of files (>200'000); we deleted all them, restarted beamium and it seems to be back to normal

@knz
Copy link
Author

knz commented Dec 5, 2020

No Greg that is a different issue. Your issue is because of a large number of files causing a lot of stat() operations. The issue above is a bug in the source code which causes a busy loop doing absolutely nothing other than eating up CPU.

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

No branches or pull requests

2 participants