SyncThing is a cross-platform, open source file synchronization tool that I’ve been using for a while now to keep my files in sync across all my devices.
Tuning
Hacks I did to the config.xml file to lower impact on my Synology NAS, which the WebUI promptly reverted upon the first time I used it:
<!-- under the main options -->
<maxHashingThreads>1</maxHashingThreads>
<maxFolderConcurrency>1</maxFolderConcurrency>
<maxConcurrentScans>1</maxConcurrentScans>
<progressUpdateIntervalS>5</progressUpdateIntervalS>
<pullerMaxPendingKiB>1024</pullerMaxPendingKiB>
<disableTempIndexes>true</disableTempIndexes>
<fsWatcherEnabled>true</fsWatcherEnabled>
<fsWatcherDelayS>10</fsWatcherDelayS>
<!-- For each folder -->
<minDiskFree unit="%">1</minDiskFree>
<copiers>1</copiers>
<pullers>1</pullers>
<hashers>1</hashers>
These had very limited effect in CPU usage, unfortunately. What did help significantly was to set most of the folders as receive-only and to rescan daily or weekly instead of the default, since I never modify files directly on the NAS.
For constrained systems, I also deploy it in a tuned systemd unit:
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=man:syncthing(1)
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0
Restart=on-failure
RestartSec=1
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
# Strict resource limits
CPUQuota=5%
MemoryLimit=512M
LimitCORE=1
# Elevated permissions to sync ownership (disabled by default),
# see https://docs.syncthing.net/advanced/folder-sync-ownership
#AmbientCapabilities=CAP_CHOWN CAP_FOWNER
[Install]
WantedBy=default.target
This is how I run it on my NAS, with minor alterations:
---
version: "3"
services:
syncthing:
image: syncthing/syncthing:latest
container_name: syncthing
hostname: diskstation
environment:
- PUID=1024
- PGID=100
- TZ=Europe/Lisbon
- HOME=/var/syncthing/config
- STGUIADDRESS=0.0.0.0:8384
- GOMAXPROCS=1
volumes:
- /volume1/homes/user:/home/user
- /volume1/docker/syncthing/user:/var/syncthing/config
network_mode: host
restart: unless-stopped
cpuset: "0"
cpu_shares: 2
healthcheck:
test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1
interval: 1m
timeout: 10s
retries: 3
Resources
| Category | Date | Link | Notes |
|---|---|---|---|
| Clients | 2020 | MobiusSync | The iOS client I’ve been using with it |
| Documentation | 2021 | Tuning | Tuning Guide1 |