lux4rd0 / weatherflow-collector

The WeatherFlow Collector is a comprehensive data collection system that gathers weather data from local UDP broadcasts and remote APIs. It seamlessly feeds this data into InfluxDB V2, which can be visualized using a set of pre-configured Grafana dashboards. The application provides real-time current conditions and detailed forecasts.
https://labs.lux4rd0.com/weatherflow-collector/
GNU Affero General Public License v3.0
75 stars 9 forks source link

Large number of dns calls to swd.weatherflow.com #10

Closed PianSom closed 3 months ago

PianSom commented 2 years ago

Hello

I recently put a pihole container on my docker instance, and have found that the weather flow-collector container is making ~8.5k dns calls to swd.weatherflow.com each 24 hours (including both IPv4 and IPv6 calls), making it by far the largest client.

This isn't a huge issue, but it does suggest that maybe there is something inefficient in the code.

lux4rd0 commented 2 years ago

@PianSom Appreciate the insights. I use Pihole as well and have similar visibility. I'm currently seeing:

136440 a day to swd.weatherflow.com and 122112 to ws.weatherflow.com. But I'm also polling a lot of different API keys.

By default, it's polling the Rest API every minute and the Forecast API every 15 minutes, and it's only one query. So the math doesn't add up.

Let me dig into this and see why there's so much more DNS activity than expected. It should be closer to 1440 DNS calls a day.

I'll see what I can find out! Thanks!!

lux4rd0 commented 3 months ago

Hoping that there will be fewer DNS calls with my latest version. It's been rewritten from the ground up, and the requests for remote API calls are shared internally. I run several collectors for dozens of Tempest devices, so I'm unable to parse out specifics - but let me know if it's still an issue! Thanks!