Data getting delayed, from my corner of internet

Hi, I continue to have problems with data getting delayed.
I wrote this 8266 program to demonstrate what I am seeing here at my end – on decent fiber internet.

This should be a link to a shared project - a screen shot is below.

The program sends the time to cayenne, with mqtt and rest, once per minute.
Then, one minute later, it queries cayenne to see what time that sample is timestamped in the cayenne database. Then calculates the difference, which is stored in the cayenne database (with mqtt).

When things are working well, the mqtt data arrives in about 1 second, and for rest, the data arrives in about 3 seconds. But at times, things are delayed 30-40 seconds, and sometimes the most recent data in the database is more than 60 seconds old.

The program also sends a sine wave with a one hour cycle, and another with a 10 minute cycle. Humans can look at these graphs to see if something has gone wrong with the curve, and compare it with the delays in the data arrival.

Also, since the rest data update is immediately forwarded back to the 8266, we can measure the time for two internet trips, plus the cayenne rerouting engine. These times are something like 3300 ms, and very consistent - even when there are 30-40 second lags in the data getting into the cayenne database.

In this screenshot, we have a normal 1-3 second lag for the first 30 minutes, and some nice sine waves, but then the lags approach 45 seconds, and the sine waves are messy, but the Roundtrip (rest send and immediate return) graph is still quite consistent. (This is mountain time, Jun 14)

Also at the bottom are the numbers for success of the rest update and query, for first try, second try, and failures after the first two attempts failed. For the last day or two, virtually everything gets through first try.

You can scroll backwards in the graphs to see prior problems - i cleaned out the old data about two days ago, so history starts then.

1 Like

this may be some problem with the internet connection causing the 30-45 seconds lag sometimes.