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
History Statistics Sensor is permanently consuming high amounts of CPU load #7800
Comments
That's a serious problem indeed. A higher scan-interval could help, at least as a temporary solution.
I don't know if it is possible, because the
That definitely deserves more thinking, I'll work on it. |
In the update method, check if |
yes, my history component displays graphs. drawing those graphs is however not producing any visible CPU load at all and querying a day worth of data is done in 1 or 2 seconds, as opposed to 1 or 3 minutes, that it takes the a higher scan intervall help reduce the permanent followup load, but it still blocks HA-startup (after restarts) for 2-3 minutes, even if theres only one history_stats sensor defined. |
thanks für taking care of this. tried your revision #7858 and as you said, this only partially fixes the problem. startup time is still delayed for about 2-3 minutes if i use the two history sensors mentioned above (without them startup time is around 20 seconds), but after that, everything is fine (till midnight). i can not observe less sql-load spikes for the queries, they (still) go up to 120-200%. |
Home Assistant release:
0.45.1
Python release:
Python 3.6.1 / macos el capitan
Component/platform:
History Statistics Sensor
Description of problem:
my recorder component is set to save data into mysql and i have two History Statistics Sensor defined:
after startup of hass cpu load spikes to 100-150% as the two History Statistics Sensors are being calculated. this takes about 2 minutes, after which hass startup is finished. unfortunatly the History Statistics Sensor keeps on calculating the history stats, which keeps the CPU load well above 100%. this is a screenshot that shows normal load (without the two sensors mentioned above) and then a restart with the sensors activated.
Expected:
The text was updated successfully, but these errors were encountered: