Syncthing causing Smartd failure at 3AM?

I have latested Syncthing installed on FreeNAS. Dell Optiplex 980 with i7-890, 16gb ram, Intel NIC. Boot is on a USB and data on spinners.

Every night around 3am, I would get a smartd is not running notification. Then a few minutes later another alert that it has cleared. Then again stop and back on. This cycle of stop and start would go on until evening, slowing down until finally stopping. Then at 3AM, it will begin again. The FreeNAS and Syncthing GUI also becomes very slow during this time. Syncing appears to still function fine. I’ve narrowed this down to syncthing after stopping all my scheduled task trying a different USB for boot. This only stops when I stop the syncthing plugin. I’ve tried to reinstall the Syncthing multiple times including moving the jail to a different drive.

There is nothing that syncthing does on a schedule (as in, at 3am every day, sure it does things every N seconds but that’s different) that could cause this.

Sure, syncthing can cause load that can lead to things failing, but the 3am part is definately not syncthing.

Perhaps you have some system task that dumps some logs at 3 am somewhere, and syncthing starts syncing them which then causes this.

My Windows PC where it syncs with is off every night. Syncthing on FreeNAS is therefore not syncing with anything at that time. The only thing syncthing can be interfering with is my one nightly snapshot at 3am? I can turn off snapshots to see if that changes anything but that doesn’t make sense. Otherwise my FreeNAS has nothing else going on but I’m pretty new to both FreeNAS and Syncthing.

Even if your stuff is off, syncthing still scans the files regardless if it’s connected to anything.

Syncthing on BSD with default settings might eat a lot of file descriptors that could cause other things to fail…

What debug logs for syncthing should I be turning on to see what files may be causing heavy loads? Probably easier to see what’s happening through Syncthing than FreeNAS. My FreeNAS is basically vanilla with just Syncthing installed and nightly snapshots of a single drive.

This may not be happening here, but Windows Update is by default set to install updates at 3 AM. What is more, Windows will automatically start the computer to install the updates, and then turn itself off again. If the installation of those updates fails for some reason, it may keep trying to do it again and again. See sleep - My Windows 8 PC wakes up every night around 3 am - Super User for more details.

Again, the problem may not be related to the Windows PC at all, but it has come to my mind looking at the specific time mentioned in this thread, so I am just throwing it out here.

If that were the case then everyone who install FreeBSD and then Syncthing would all have the same problem. I can’t be the only person has this experience out the gate.

Thanks for the info I didn’t realize Windows did this! I checked my options and my computer is set to wake at 2AM. But my computer is off every morning when I come back to it so I doubt that’s what’s happening. What is going on is just with the FreeBSD computer and Syncthing together.

Windows will turn the computer off automatically after doing its “maintenance”, so being off every morning is the expected result. Can you check the Event Viewer just to be sure that no shenanigans take place at night?

I looked at Windows event viewer any nothing is logged for middle of the night. It all looks clean. My smartd alerts are cycling on/off again and the Web GUIs are very slow. This time the alerts came later at 3:47AM. It’s never exactly at 3AM.

Did you check general top/htop/iotop whatever for what’s causing the load? Cpu/io/ram use etc? What does syncthing ui actually show, is it scanning/syncing?

Woke up this morning to the same issue of slow WebGUI and first smartd alert email at 3:07AM and still continuing on/off cycle, with the interval slowing down as usual.

Ram is 8.4GB Free, 2.6GB services, and ZFS Catche 4.7 GIB.

CPU shows 100% spike cycles starting at 3am. The spikes probably correlate to when smartd fails.

Boot USB at ~3am: Disk Latency shows read between 3msec and 6msec the starts ~3am and ending at ~8am. Disc operations average of ~10ops/sec spikes to 40 op/sec at 3am for just ~15min. Disk busy spikes to 4% from 1$.

The spinner that syncthing is reading actually shows no activity at 3am.

Syncthing UI shows “Up to Date”.

Stopping and restarting the Syncthign plugin will clear the slow WebGUI sluggishness and smartid errors.

And whats causing those cpu spikes?

I can’t tell. Looking at System Processes now it shows 0% CPU usage and the load appears to have disappeared by ~7AM. The WebGUI sluggish and smartd alerts still going. Syncthing appears to still be syncting though.

(this graph lacks previous dated because I just switched the CPU reporting to show different units)

Over last week (zooming it will show constant spikes)

I found this post and just turned off “watch for changes”. My WebGUI slow down has cleared and I suspect smartd alerts won’t come back either. Why does this happen?

See previous Jakob’s response.

So Jakob is saying Syncthing doesn’t play nicely with FreeNAS out the box unless some tinkering is done? But there’s no standard help in what this tinkering would be?

Syncthing being a part of the iXsystems collection from FreeNAS made me assume it was trouble-free out the gate.

There are tons of threads about FreeBSD watching issues on the forum, use the search.

You can think your system is “trouble free”, but it’s clearly not. We don’t cater for any system specifically, so brand names have no meaning to us.

Anyone reading this, don’t bother searching the forum. There is no solution other than disabling watch for changes feature.