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

higher CPU usage with 2022.12.X caused by a "python3" process #83845

Closed
Anto79-ops opened this issue Dec 12, 2022 · 9 comments · Fixed by #83861
Closed

higher CPU usage with 2022.12.X caused by a "python3" process #83845

Anto79-ops opened this issue Dec 12, 2022 · 9 comments · Fixed by #83861

Comments

@Anto79-ops
Copy link

Anto79-ops commented Dec 12, 2022

The problem

Hello all,

Since updating to 2022.12.2 I've noticed an increased CPU usage by about 8 to 12%. Glances tells me is its python3 process here:

207085258-53272fb0-39fb-4e42-8a3e-cc97c58d8511_2

and this is my CPU trace for the last couple of days. Please ignore those spikes in CPU in the red section. Those are FW updates to my ESP32 boards via ESPhome and not related to reported issue. The issue here starts in green section of the CPU trace, the constant elevated background CPU usage around 30%.

image

At first, I thought it was related to this issue, but I did not notice a leak and I only have Nest cameras and a generic camera for my Fully Kiosk FireTab HD10.

I did not add:

  • an integration
  • an addon
  • a custom integration

The higher CPU usage started immediately after restart to 2012.12.2 from 2012.12.1 Shutting down the system for a few minutes and rebooting does not solve the issue either.

Running Raspberry Pi 4B, 4Gb.

What version of Home Assistant Core has the issue?

2022.12.3 and 2022.12.2

What was the last working version of Home Assistant Core?

2022.12.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

core

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homeassistant/

Diagnostics information

see photos above

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@JackTalisker
Copy link

I can confirm that cpu usage is now higher than in 2022.11.x releases.
I used to have 4-7% and now is 13-20% (docker install on raspi PI 3b without video streams and no cameras handling at all)

@balloob
Copy link
Member

balloob commented Dec 12, 2022

Can you generate a profile to see where the time is being spend? https://www.home-assistant.io/integrations/profiler

@Anto79-ops
Copy link
Author

Oh nice tool, @balloob ! Ok, I installed the Profiler integration, and ran the service for 60 seconds. Here are the files it generated.

I changed the extension to txt so I can upload it here. If there is any sensitive information in, please let me know and I will remove it. thank you.

profile.1670862529728020.cprof.txt
callgrind.out.1670862529728020.txt

@emontnemery
Copy link
Contributor

@Anto79-ops There's nothing sensitive in the files. Could you collect a profile during also with Home Assistant 2022.1, where you don't see the issue?

@Anto79-ops
Copy link
Author

@emontnemery no problem sure. Could you tell me how to downgrade to 2022.12.1? I've never actually done this before. Thanks

@AJediIAm
Copy link

AJediIAm commented Dec 12, 2022

Screenshot_20221212-193412
All I wanted to add is that I experience a similar CPU increase as shown above. The CPU spike is the update from 2022.12.1 to 12.3. Looking back into the history of the past 2 weeks, CPU was generally as it was with 2022.12.1

This is my CPU over the last week:
Screenshot_20221212-202758

@frenck
Copy link
Member

frenck commented Dec 12, 2022

@Anto79-ops Use an SSH or web terminal and run the following command:

ha core update --version 2022.12.1

(please note, this command should not be used to downgrade to other major versions, jumping patch versions should be fine).

@Anto79-ops
Copy link
Author

thanks @frenck for the instructions and disclaimer for using the downgrade option!

Good news, after successfully downgrading to 2022.12.1, my CPU usage goes back to normal (i.e. between 14 and 18%), as shown here at the green dot in the CPU trace.

image

I waited about 15 minutes to collect the profile trace, and here are those files. Hopefully something comes out at you @emontnemery

thanks again for looking into this.

callgrind.out.1670875369047342.txt
profile.1670875369047342.cprof.txt

@Anto79-ops
Copy link
Author

Thank you very much all! I upgraded to 2022.12.4 last night (8 hrs ago) and my CPU is back to normal levels! Cheers

@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants