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

Excessive dns requests #9

Open
snufk1ns opened this issue Aug 25, 2020 · 2 comments
Open

Excessive dns requests #9

snufk1ns opened this issue Aug 25, 2020 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@snufk1ns
Copy link

Hi, thank you for this plugin, really good. 👍🏻

I’ve noticed that the plugin is hammering the dns server with new queries all the time (vocapi.wirelesscar.net). About 45K/day. Is this really necessary?

@trympet
Copy link
Owner

trympet commented Aug 26, 2020

Hi, thanks!

At the moment, since I am using node-fetch, http sockets are not durable. This means that a new TCP connection is created upon every request, along with a corresponding DNS request. However, on most deployments, this should not be a problem, as most operating systems cache DNS records locally by default; on Debian: systemd-resolved.

One option would be to use a persistent connection with keep-alive (if the VOC API supports it). This requires the fetch API to be swapped out with the node-http API.

Another option would be to modify the update interval in the config.

Despite this, 45k req/day is still abnormal, since two requests at 10s (default) intervals would only add up to ~20k req/day. Feel free to dig though the source code if you want. I'll try to have a look and see if I can spot something.

@trympet trympet self-assigned this Aug 26, 2020
@trympet trympet added bug Something isn't working good first issue Good for newcomers labels Aug 26, 2020
@snufk1ns
Copy link
Author

Just FYI - I had to disable this plugin.

While enabled and working fine. It drained the battery on both my cars in about 10 days. Not sure if its frequent polling that keeps the system in the car active for longer or what. As soon as I disable this plugin, the battery in the cars last for much longer. ( I use a CTEK battery monitoring to check status).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants