bbindreiter / node-red-contrib-alexa-remote2-applestrudel

Node-Red Nodes for interacting with Alexa
https://flows.nodered.org/node/node-red-contrib-alexa-remote2-applestrudel
MIT License
75 stars 20 forks source link

Node is making 4+ api requests per second causing lots of DNS lookups #71

Closed biddster closed 2 years ago

biddster commented 2 years ago

I'm using the latest version 5.0.11 and I'm seeing a lot of DNS lookups to eu-api-alexa.amazon.co.uk. It's roughly about 4 per second. I noticed this as I use pihole and it was making so many calls that pihole eventually rate limited the client. Nothing is being blocked by pihole. Functionally, this node is brilliant and is just what I need.

I've enabled trace and this is what's happening in the debug log (over and over again):

18 Jul 22:06:33 - [debug] [alexa-remote-account:d2ad57c429e59850] Alexa-Remote: No authentication check needed (time elapsed 231251)
18 Jul 22:06:33 - [debug] [alexa-remote-account:d2ad57c429e59850] Alexa-Remote: Sending Request with {"host":"eu-api-alexa.amazon.co.uk","path":"/api/devices-v2/device?cached=true&_=1658178393881","method":"GET","timeout":10000,"headers":{}}
18 Jul 22:06:33 - [debug] [alexa-remote-account:d2ad57c429e59850] Alexa-Remote: Response: {"devices":[ "removed for brevity" ]}

It's my first time using this node so I'm not sure this is normal?

I've got events disabled in the account configuration as I thought that might be the issue but it's not.

Happy to help debug if this is a bug.

bbindreiter commented 2 years ago

That's definitely not normal. Just checked my PI and I don't have this behavior. Have you used this node before and it's happening since the last update?

Thanks!

biddster commented 2 years ago

I'm a new user to this node. I was using the mattl0 fork for a few days before switching to your fork. I think it started when the latest alexa-remote package was pulled in, but I can't be sure. I started using mattl0 around the 11th of July.

I reported this on the mattl0 fork https://github.com/MattL0/node-red-contrib-alexa-remote2-mattl0/issues/3

biddster commented 2 years ago

This afternoon I removed all alexa nodes. I created a new alexa account and one by one added the alexa nodes I need back in. I added one node per half-hour so I could check the effect on the DNS lookups. The upshot is that it's fine.

Screenshot 2022-07-19 at 19 45 07

I'll monitor over the next few days and close this.