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 usage #41

Open
desosav opened this issue Jul 21, 2022 · 3 comments
Open

High cpu usage #41

desosav opened this issue Jul 21, 2022 · 3 comments

Comments

@desosav
Copy link

desosav commented Jul 21, 2022

Don't know if this is an issue, but since the last couple of changes/releases i notice that the cpu utilization is increased by approximately 10% per boiler. I am running homeassistant on Raspberry pi4 and i monitor 2 Genus One boilers.
So i did some tests to see what's happening.
Up until version 2.0.0 the total cpu utilization was around 6-7%. When version 2.0.2 was installed the total cpu utilization increased to 27%. Disabling the ariston yaml file makes the cpu utilization drop to 6-7%. Disabling one of the 2 boilers that are configured in ariston yaml file make the cpu run at 17%. If i remove some sensors, selectors, etc i can make the cpu run at 10%.
Is this normal or expected considering the latest modifications?

@chomupashchuk
Copy link
Owner

Since Ariston changed requests I had to rewrite most of functionality. Higher CPU can be a result of different factors:

  • in older versions reading of data was limited while setting data, but I doubt that is the case
  • new version has a bit more calculations for data mapping, less preset dictionaries and more dynamic calculations, some actions that are run in different threads were changed from 1s delay to immediate.
    Reducing CPU use requires profiling to identify problematic places. I did not bother as I run it on NAS as container with 4 x86 CPU cores available. But maybe it is good to optimize it a bit.

@fabiopellegrin
Copy link

Hi,
looking with py-spy with and without the integration seems that the deepcopy in sensor_valuse() is cousing the cpu usage.
2022-09-18 15-53-05

Hope this helps a little bit :)

BR

@esistgut
Copy link

esistgut commented Dec 7, 2022

I can confirm the issue, this is the CPU usage with this addon enabled:
01
and this is the CPU usage without this addon:
03
and this is my configuration:

ariston:
  username: !secret ariston_username
  password: !secret ariston_password
  sensors:
    - ch_detected_temperature
    - ch_mode
    - errors_count
    - mode
    - outside_temperature
  binary_sensors:
    - changing_data
    - online
  selector:
    - mode
    - ch_mode

I'm on RaspberryPi 4.

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

4 participants