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

Pins cpu usage at 100% #395

Open
ym1234 opened this issue Jun 16, 2023 · 4 comments
Open

Pins cpu usage at 100% #395

ym1234 opened this issue Jun 16, 2023 · 4 comments

Comments

@ym1234
Copy link

ym1234 commented Jun 16, 2023

As shown here:
image

Seems like there is a weird interaction between aw-watcher-window and the rust server, because if I turn that off the cpu usage returns to normal.

Info:
aw-server 0.12.2
aw-server-window ????
distro: arch, x11
Python 3.11.3 (I don't think this related)
Linux 6.3.8-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC

@ErikBjare
Copy link
Member

What do the logs say?

@ym1234
Copy link
Author

ym1234 commented Jun 17, 2023

Nothing

[2023-06-17 20:26:37][�[32mINFO�[0m][aw_server]: Using DB at path "/home/ym/.local/share/activitywatch/aw-server-rust/sqlite.db"
[2023-06-17 20:26:37][�[32mINFO�[0m][aw_server]: Cannot find assets "./aw-webui/dist/"
[2023-06-17 20:26:37][�[32mINFO�[0m][aw_server]: Using aw-webui assets at path "/opt/activitywatch/aw-server-rust/./static/"
[2023-06-17 20:26:37][�[32mINFO�[0m][aw_server::endpoints]: Starting aw-server-rust at 127.0.0.1:5600
[2023-06-17 20:27:49][�[33mWARN�[0m][rocket::server]: Received SIGINT. Requesting shutdown.
[2023-06-17 20:27:49][�[32mINFO�[0m][aw_datastore::worker]: DB worker quitting
2023-06-17 20:27:07 [INFO ]: aw-watcher-window started  (aw_watcher_window.main:62)
2023-06-17 20:27:08 [INFO ]: Connection to aw-server established by aw-watcher-window  (aw_client.client:436)
2023-06-17 20:27:43 [ERROR]: Unhandled exception  (root:52)
Traceback (most recent call last):
  File "aw_watcher_window/__main__.py", line 4, in <module>
  File "aw_watcher_window/main.py", line 89, in main
  File "aw_watcher_window/main.py", line 144, in heartbeat_loop
KeyboardInterrupt

@ErikBjare
Copy link
Member

ErikBjare commented Jun 17, 2023

Can you reliably reproduce? Try running with verbose logging.

@ym1234
Copy link
Author

ym1234 commented Jun 17, 2023

Found the problem, for some reason I had ~70mb persistqueue files for both the window and afk watchers,
leading them to hammer the server with requests trying to update the main database which shot the cpu usage to 100% (I assume? I'm not familiar with how aw works). Deleting these files solved the problem.
Maybe there should be something that warns the user when the size of queued operations exceeds some limit?
https://0x0.st/HTu_.png

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