On Thursday, 26 March 2020 13:21:55 UTC+10, Lucas Heijst wrote:

> I think the fact that weewx can't keep up in time to handle the 1-minute 
> archive data is the reason that the memory is filled.
>

I think you are being a little harsh here Luc. From what i can read of the 
log extracts you are running a rather complex setup (two instances of WeeWX 
and at least three databases). I can think of a number of scenarios that 
could cause the symptoms you are seeing and none involve WeeWX not 'keeping 
up'.
 

> Each archive record contains 90 real values (doubles) and these values are 
> stored in memory (I suppose) as long as they are not written to the 
> database. 
>
One hour before the low-memory crash weewx was 90 1-minute archive records 
> behind.
>

Might help to have a little more info if you want any meaningful advice 
other than maybe this or maybe that. 

Are you running with software archive record generation? If so then WeeWX 
does not store any archive records (other than at most two, the last one 
that is being processed and the current one that is being accumulated). 
WeeWX accumulates loop packets and as soon as WeeWX receives a loop packet 
that belongs in the next archive period WeeWX synthesises an archive record 
and emits a NEW_ARCHIVE_RECORD event which causes that archive record to be 
archived and otherwise processed by the WeeWX services. The loop packet 
from the next archive period (and subsequent loop packets) are accumulated 
to create the next archive record. And the process repeats. So on a system 
with a driver that normally emits loop packets every 4 seconds, but for 
some reason these loop packets are being blocked within the driver and 
released much less frequently, WeeWX will only emit an archive record once 
it has received a loop packet timestamped in the next archive period. So 
what you can see happening is archive records being emitted and saved to 
database but at intervals much longer than the archive interval, in many 
cases the interval between these archive records being emitted increases as 
more and more loop packets are delayed. Ultimately an out of memory error 
can occur, if things haven't ground to a halt beforehand.

How about providing some config details? A debug log from startup would 
show almost everything needed to gicve us a more complete picture of your 
setup. What about your driver, does it interrogate hardware in its own 
thread or in the WeeWX thread? If it is not in its own thread it is 
possible that it is blocking and causing delays. What happens when you run 
WeeWX directly, do you see loop packets appearing, does the difference in 
successive loop packet timestamps align with the frequency they appear on 
the console? (ie if the loop packets are timestamped every four seconds do 
they appear on the console every fours seconds or every 15 seconds, 30 
seconds, 60 seconds?) If there is a discrepancy that is a sure sign that 
something is blocking. How about posting a copy of the driver?

Hard to say a great deal without more logs, more config details and more 
driver details.

Gary

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-development+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/402c8712-b979-4d29-a056-2b745068f1e0%40googlegroups.com.

Reply via email to