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

[Bug] High CPU idle usage #801

Closed
ThibaultNocchi opened this issue Apr 8, 2024 · 4 comments
Closed

[Bug] High CPU idle usage #801

ThibaultNocchi opened this issue Apr 8, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ThibaultNocchi
Copy link

ThibaultNocchi commented Apr 8, 2024

RomM version
3.0.3

Describe the bug
When not using it and when no scheduled job is running, Romm idles around 10% usage of my CPU. For instance, Photoprism hovers at 8% when scanning the photos directory hourly.

My CPU is an i3 12100.

To Reproduce
Use top or anything else to monitor CPU usage

Expected behavior
At best it shouldn't consume all that CPU when idling. Maybe we could reduce in config what's taking up power. Or if nothing is possible, I'm just curious to know why

Screenshots
image

Additional context
I'm running the official container image.
When running htop it seems that the culprit process is python3 scheduler.py

As workaround I've limited the CPU the container can use to 250m of a vCPU instead of the ~750m it was actually using

Thanks!

@ThibaultNocchi ThibaultNocchi added the bug Something isn't working label Apr 8, 2024
@gantoine
Copy link
Member

gantoine commented Apr 9, 2024

That's so interesting, I've been investigating high RAM usage (~500MB at idle) for a bit with no luck, but high CPU usage is not something we've observed. I'll have a look when I find a bit of time.

When running htop it seems that the culprit process is python3 scheduler.py

This will be helpful, thank you! Could you also post your docker-compose?

As workaround I've limited the CPU the container can use to 250m of a vCPU instead of the ~750m it was actually using

This is good practice, I do the same with all my containers.

@gantoine gantoine self-assigned this Apr 9, 2024
@ThibaultNocchi
Copy link
Author

I'm not running in Docker but in Kube, but here is the equivalent Docker:

docker run \
 -e DB_HOST=romm-mariadb -e DB_NAME=romm -e DB_USER=romm -e ROMM_AUTH_USERNAME=admin -e IGDB_CLIENT_ID=secret -e IGDB_CLIENT_SECRET=secret -e DB_PASSWD=secret -e ROMM_AUTH_SECRET_KEY=secret -e ROMM_AUTH_PASSWORD=secret \
 --cpus=0.25 \
 rommapp/romm:3.0.3

With volumes and a config.yml mounted. I also have MariaDB in another pod.

I'll happily provide you anything you need. :)

@ThibaultNocchi
Copy link
Author

Hey!

Yesterday I noticed a scanning bug, and guess I didn't read the Romm logs: I had multiple Redis errors saying it didn't have rights to write, such as this: #812 (comment)

I fixed the error by chowning it, and it seems to have fixed my CPU usage. Ofc I dropped my Prometheus database this morning so I can't verify if the fix matched the CPU usage, but now it's idling well.

Thanks for your help, we may close the issue!

@gantoine
Copy link
Member

Ok awesome! This would have fixed itself when 3.1 went live and you upgraded, but I'm glad to hear CHOWNing it worked. 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants