hombach / ioBroker.tibberlink

links tibber API data to be used in ioBroker
https://github.com/hombach/ioBroker.tibberlink
GNU General Public License v3.0
25 stars 5 forks source link

Do not access cloud services at fixed timestamps #252

Closed mcm1957 closed 11 months ago

mcm1957 commented 11 months ago

Describe the bug

Tibber cloud service seems to be accessed at fixed timestampes defined by crontab. This will lead to high load peaks at the cloud service as all ioBorker installations will use the service at almost the same time. Cloud provide might block access from ioBroker to avoid this - thus breaking the adapter for all users.

Please use random timestamps, i.e. randomizing cron entry, by delaying the access several minutes, ...

Expected behavior
Access should net be performed at almost the same time by hardcoded crontab or timestamp values.

Versions:

Additional context
Please add this fix for the next release you plan to release as stable.

hombach commented 11 months ago

I hope Tibber has much more traffic - so that the 1000 accessing machine don't really count, - BUT this is a very good idea!!

hombach commented 11 months ago

implemented for 2.0

mcm1957 commented 11 months ago

Thanks. In regards to your comment abot 1000 Users. We ('ioBroker') had already more than once feedback from cloud providers and even blocking measurements caused by to high load peaks. So @Apollon77 and I try to catch all possible adapters and try to convince devs to randomize the access even if the adapter is curently only used by few people. We want to avoid any situation where services are overloaded or cloud providers explicitly prohibit usage of their service for non own applications.

Thanks for implementing a randomization.

mcm1957

hombach commented 11 months ago

Hi Martin, good to know that already blocking issues have happened. Hopefully I'm not too "pseudo random" by using math.random. I don't know what seed is used in node.js to start the algorythm....

hombach commented 11 months ago

2.0.0 released for latest (beta) repository