>  My guess is that your weewx instance is CPU bound and really is running 
behind.  

You may be on to something.  I watched top for a while.  CPU load on the 
python2 process runs under 10% when MQTT is posting loop records.  But 
every five minutes, when the archive records and web pages are being 
generated, the CPU load of the python2 process jumps up over 100%.  In 
/var/log/messages, the MQTT records are posting on time, but fall behind by 
10 seconds or more when the archive records and web pages are generated.  
The MQTT records then catch up again almost immediately after the archive 
activity dies down.  I may have to dig around in the log files a bit more 
to find lags that it did not recover from.

On Saturday, October 31, 2020 at 6:47:04 AM UTC-7 Greg Troxel wrote:

>
> T Reid <trgo...@hoghill.net> writes:
>
> > As I feared, the problem is not fixed. The lag between the posting of 
> MQTT 
> > records by weewx and the current time has wandered all over the place 
> over 
> > the past two days. It has gone from dead on time to 1.5 hours behind, 
> and 
> > everything in between. Last night it was doing okay, this morning it was 
> > 80 minutes behind, and now it is 20 minutes behind. There is no rhyme or 
> > reason to it. The only constant is that weewx can't seem to post MQTT 
> > records on time on a consistent basis.
>
> My guess is that your weewx instance is CPU bound and really is running
> behind.
>
> Is your archive interval 5 minutes, or something longer? If it's
> shorter than 5 minutes, then don't do that!
>
>
> I suggested restarting the broker because if the problem was in the
> network going to the broker, then the reconnect would start fresh. But
> you see old records newly appearing after the broker restart, which more
> or less proves that weewx is newly posting them after the restart.
>
> So look with ps, top, and so on about CPU usage. Check if your html
> skins are being generated on time, and transferred to your web server
> etc., or if those also are slow.
>
> Try to simplify your setup in terms of skins and generating things, and
> see if that helps. If it does, that supports the "not enough CPU time"
> theory.
>
> Back off from loop to archive in mqtt, and see if that is reliably
> timely. I'm not saying you should run that way, or have to, but it's an
> interesting data point.
>
> I am running weewx on a Raspberry Pi 3 (NetBSD 9) with a VP2, and every
> 5-minute archive interval:
>
> generate 2 skins
> rsync them
> post aggregate data to mqtt
>
> and I do not publish loop data. I just looked and the weewx python
> process has used 17 hours of CPU time in 16 days.
>
> > - I looked at the traffic with mosquitto_sub, and the incoming
> > weather data right now is from 45 minutes ago.
>
> It would be interesting to know if the inter-message arrival rate is the
> same as the intended transmit rate, or if it catches up some between
> archive intervals and then has a bigger lag over them.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/63939b20-1f02-42bb-8aff-0b60048dda4en%40googlegroups.com.

Reply via email to