Hi, I never sent data to sensor.community before, so not sure if this some temporary degradation or this is “normal” behavior, or there is something wrong on my side. I do have occasional periods when my internet connection feels a bit slow connecting to some servers (but not all, maybe depends on location). To understand if that’s something on my side, I also sent data to madavi.de, which is (as I understand) located somewhere near.
So what I see, is sending data to api.sensor.community often takes quite a lot of time. I don’t know exact distribution, as I have only 1 second timeout in my ESPHome device. But trying to send requests from my PC, I see that it could take 5-30 seconds. Below you can see a screenshot with detailed timing. However, seems like it varies quite a lot. Even in “slow periods”, some requests complete quite fast <1s. I haven’t run my sensor for long time yet, but it seems that there are some “slow periods” when requests timeout 95% of time (in my case 1s timeout as I said), and “fast periods” when most of requests complete successfully within 1s timeout.
Also, you can see that in screenshot below total request time is mainly a sum of TCP Handshake + Transfer start. I wouldn’t say TCP Handshake takes always that much, usually more often time is spent somewhere after connection was established, but still it occurs quite often, it seems like some server/web server issue rather than app code or database. And note, that I’m not using HTTPS, just plain HTTP.
For comparison, I also send data to madavi.de. I’m not sure how it relates to sensor.community and whether they use similar backend/db, but usually requests to it complete much faster.
Also I have a question, if it possible to send data to sensor.community in one request (temperature + PM) like it is possible with madavi.de? It is especially could be useful if requests take long time. Having a single 5-30s request is better than 2 of them.
Why I’m setting such small timeout =1s? I’m using ESPHome and by default it has 5s watchdog, which is a background timer that checks that no thread blocks loop for long time. If it does - it reboots the device. So I’m considering 2 options:
- Increasing this timeout. However, as I’ve seen some requests could take ~30sec and if you send 2 of them sequentially, I’m not sure what timeout should be “good enough”, and I believe blocking the loop for long time is not a good practice, as there are some other background tasks that ESP (like wifi) might want to execute.
- Just ignoring timeouts. Seems like despite receiving timeouts the data still passes through most of the time, I’m just not getting confirmation whether the request was successful or not. However I’m not sure if that the case when timeout happens on TCP handshake stage.
I understand that you have quite a number of sensors (like ~13K, if that’s the correct number on the home page) that are sending you data every few minutes, but still it feels a bit strange that inserting 3 values into DB might take this long.