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

High CPU utilization while idle #142

Open
skoch13 opened this issue Feb 26, 2024 · 5 comments
Open

High CPU utilization while idle #142

skoch13 opened this issue Feb 26, 2024 · 5 comments

Comments

@skoch13
Copy link

skoch13 commented Feb 26, 2024

Thank you for this amazing project!

I noticed high CPU usage while being idle. Is this a known issue?

Screenshot 2024-02-26 at 14 15 10

@tkellogg
Copy link
Owner

I've suspected that this could be an issue, although it isn't for me personally. Can you send a sample of /opt/homebrew/var/log/dura.log.json and /opt/homebrew/var/log/dura.stderr.log?

@skoch13
Copy link
Author

skoch13 commented Feb 26, 2024

Sure
dura.tar.gz

@skoch13
Copy link
Author

skoch13 commented Mar 9, 2024

Hey, I'm just checking if anything else is needed from my side to proceed with the investigation.

@tkellogg
Copy link
Owner

Hi, sorry for being slow. I need more info. I was hoping to put together instructions for you to install flamegraph, but I couldn't get them to work myself. The problem is that flamegraph needs to run as sudo, but if dura runs as sudo i'm concerned it will write files into the .git dir as sudo, which might corrupt the index (fix: adjust the permissions).

This is what I had written


Hey, if you don't mind, can you please follow some steps to capture some debug info for me? It'll help a lot.

Install flamegraph (you may need to install rustup first)

cargo install flamegraph

Edit /opt/homebrew/opt/dura/homebrew.dura.service and change the array after ProgramArguments to look like this:

	<array>
		<string>/Users/tim/.cargo/bin/flamegraph</string>
		<string>--output</string>
		<string>/opt/homebrew/var/log/dura.perf.svg</string>
		<string>--</string>
		<string>/opt/homebrew/opt/dura/bin/dura</string>
		<string>serve</string>
	</array>

(obvs fix the home dir)

Restart dura:

brew services restart dura

You might see a notification if it worked:

image

@skoch13
Copy link
Author

skoch13 commented Mar 11, 2024

While following the instructions provided on MacOS 14.4 the process looks a little bit different from described:

  1. brew install rustup-init
  2. execute rustup-init
  3. edit /opt/homebrew/opt/dura/homebrew.mxcl.dura.plist
  4. resulted in
❯ brew services start dura
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/user/Library/LaunchAgents/homebrew.mxcl.dura.plist` exited with 5.
~/
❯ sudo brew services start dura
Password:
Warning: Taking root:admin ownership of some dura paths:
  /Users/user/.cargo/bin
  /Users/user/.cargo/bin/flamegraph
  /opt/homebrew/opt/dura
  /opt/homebrew/opt/dura/bin
  /opt/homebrew/var/homebrew/linked/dura
This will require manual removal of these paths using `sudo rm` on
brew upgrade/reinstall/uninstall.
Warning: dura must be run as non-root to start at user login!
==> Successfully started `dura` (label: homebrew.mxcl.dura)
~/
❯ brew services info dura
dura (homebrew.mxcl.dura)
Running: ✘
Loaded: ✔
Schedulable: ✘
~/
❯ brew services start dura
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/user/Library/LaunchAgents/homebrew.mxcl.dura.plist` exited with 5.

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

No branches or pull requests

2 participants