Author Topic: Exports randomly flaking out  (Read 2424 times)

falcon

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Exports randomly flaking out
« on: July 13, 2015, 02:33:14 PM »
I've had this happen 3 times now. I have a script set up to get the export from the device every minute and dump it into an SQL database so I can do more with it than the footprints software is capable of. After a week or two, one of the MTU's exports just stops working. It'll start feeding bad data that's hours in the future, and it will not fix itself. In order for me to fix it, I have to reset the history AND reset the totals to zero in order for it to start working properly. Now, I can script this to happen every night if I have to (or whenever it starts getting future timestamps, I suppose), but I really don't want to have to because I'll lose 1 minute of data every time I do. I'm looking for what could cause this.

pfletch101

  • Sr. Member
  • ****
  • Posts: 427
  • Karma: +0/-0
    • My home page
Re: Exports randomly flaking out
« Reply #1 on: July 13, 2015, 05:51:46 PM »
I've had this happen 3 times now. I have a script set up to get the export from the device every minute and dump it into an SQL database so I can do more with it than the footprints software is capable of. After a week or two, one of the MTU's exports just stops working. It'll start feeding bad data that's hours in the future, and it will not fix itself. In order for me to fix it, I have to reset the history AND reset the totals to zero in order for it to start working properly. Now, I can script this to happen every night if I have to (or whenever it starts getting future timestamps, I suppose), but I really don't want to have to because I'll lose 1 minute of data every time I do. I'm looking for what could cause this.

I wonder if, under some relatively unusual circumstances, a minute isn't long enough to complete the export (either because the computer running the script is busy doing something else or because the ECC is), and the 'collision' between the start of the new request and the tail end of the old one causes your problems. I can't think of a good reason for exporting data every minute (even second data is stored internally for a bit over an hour), so the first thing I would try is doing your export less frequently (perhaps every 15 minutes), and seeing if this solves the problem.
Peter R. Fletcher
TED Pro Home - main MTUs monitoring utility and PV Solar feeds; 2 Spyders monitoring selected individual circuits

falcon

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Exports randomly flaking out
« Reply #2 on: July 14, 2015, 11:23:40 PM »
I'm getting the raw requests, and I'm only requesting 60 entries. It pulls up near-instantaneously.

The reason I'm doing it every minute is because, when I look at the data on my server, I don't want it to be delayed by 15 minutes. I'd use the footprints posting functionality, but it's not nearly as informative. I can't stand using the Footprints UI with its non-responsive layout, especially on my phone.

pfletch101

  • Sr. Member
  • ****
  • Posts: 427
  • Karma: +0/-0
    • My home page
Re: Exports randomly flaking out
« Reply #3 on: July 15, 2015, 02:11:00 AM »
I'm getting the raw requests, and I'm only requesting 60 entries. It pulls up near-instantaneously.

I'm sure it does, most of the time. My suggestion could well be wrong, but 'near-instantaneous' response to a few test downloads does not exclude something different happening with an incidence of < 1:10,000, which is what you are describing.

Quote
The reason I'm doing it every minute is because, when I look at the data on my server, I don't want it to be delayed by 15 minutes. I'd use the footprints posting functionality, but it's not nearly as informative. I can't stand using the Footprints UI with its non-responsive layout, especially on my phone.

What do you actually use the second data for? I mostly use my own software for display, download minute data every five minutes, store it all, and change my displayed numbers using the latest sample at each download, so they can admittedly be up to 6 minutes behind. There are retrospective surveys and calculations that I have used the stored minute data for, but I have never felt the need to try and look at my power usage on a second by second basis.
Peter R. Fletcher
TED Pro Home - main MTUs monitoring utility and PV Solar feeds; 2 Spyders monitoring selected individual circuits

falcon

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Exports randomly flaking out
« Reply #4 on: July 15, 2015, 02:41:33 AM »
I'm not using the second data. I'm getting the minute data, every minute. The only reason I fetch 60 is if the server or piece of my network gets restarted and it misses some, or the cron job fails to fire, or I miscode something and don't notice it for a few minutes, etc. If I was calling the second data, it wouldn't be for storage; just for display, and I'd call it the same way the footprints software does through the SystemOverview XML file. If this were a problem with access frequency, don't you think the dashboard, which calls multiple XML files every second, would also cause it to happen?

The thing is, if it breaks, it doesn't just give me bad readings. it shows those bad readings on the MTU itself. They're now part of the dataset. That doesn't seem like something a read-only call should be able to screw up.