Syncthing on SQLite -- help test!

Thanks! I made some tweaks to increase concurrency and make bulk inserts faster at the price of safety (like turning off journalling and fsyncs) – but in any case the migration will be retried from start if it does not complete. Also added some stats to show better what’s going on.

For me this reduced the total time to about a third of what it was before, it would be interesting to see how it works out for you and what the stats are. This is what I see (Linux, default Go & GCC, Xeon E-2274G, some SATA SSD):

[start] 2025/03/23 10:13:04 INFO: syncthing v2.0.0-beta.9.dev.4.gfdfa19fc-sqlite "Hafnium Hornet" (go1.24.1 linux-amd64) jb@unu 2025-03-23 10:02:01 UTC
[start] 2025/03/23 10:13:05 INFO: Migrating old-style database to SQLite; this may take a while...
[start] 2025/03/23 10:13:05 INFO: Migrated folder 7ojpy-cfjhl; 11 files and 1k blocks in 0s, 825.4 files/s
[start] 2025/03/23 10:13:05 INFO: Migrated folder f3g2c-xkhxh; 2408 files and 12k blocks in 0s, 3910.9 files/s
[start] 2025/03/23 10:13:08 INFO: Migrated folder kzjer-zz3bg; 4687 files and 146k blocks in 2s, 2204.0 files/s
[start] 2025/03/23 10:13:16 INFO: Migrated folder marir-bw9mx; 1591 files and 1312k blocks in 8s, 186.1 files/s
[start] 2025/03/23 10:13:26 INFO: Migrated folder ml3yu-v9kaa; 3053 files and 1133k blocks in 9s, 320.3 files/s
[start] 2025/03/23 10:13:30 INFO: Migrated folder p3jms-73gps; 2492 files and 410k blocks in 4s, 577.4 files/s
[start] 2025/03/23 10:13:32 INFO: Migrated folder rmvlx-cekie; 4861 files and 99k blocks in 2s, 2276.6 files/s
[start] 2025/03/23 10:13:32 INFO: Migrated folder rozef-xd4qh; 5 files and 8k blocks in 0s, 64.1 files/s
[start] 2025/03/23 10:13:36 INFO: Migrated folder smaoh-2qdsh; 5016 files and 254k blocks in 4s, 1207.8 files/s
[start] 2025/03/23 10:13:46 INFO: Migrating folder uk9gc-dkerd... (52000 files and 93k blocks in 10s, 5180.3 files/s)
[start] 2025/03/23 10:13:49 INFO: Migrated folder uk9gc-dkerd; 62701 files and 131k blocks in 12s, 4962.8 files/s
[start] 2025/03/23 10:14:00 INFO: Migrating folder w3ejt-fn4dm... (11000 files and 862k blocks in 10s, 1015.1 files/s)
[start] 2025/03/23 10:14:10 INFO: Migrating folder w3ejt-fn4dm... (22000 files and 1719k blocks in 21s, 1036.9 files/s)
[start] 2025/03/23 10:14:21 INFO: Migrating folder w3ejt-fn4dm... (31000 files and 2562k blocks in 32s, 965.5 files/s)
[start] 2025/03/23 10:14:32 INFO: Migrating folder w3ejt-fn4dm... (41000 files and 3365k blocks in 42s, 954.2 files/s)
[start] 2025/03/23 10:14:43 INFO: Migrating folder w3ejt-fn4dm... (47000 files and 4174k blocks in 53s, 875.9 files/s)
[start] 2025/03/23 10:14:53 INFO: Migrating folder w3ejt-fn4dm... (57000 files and 4846k blocks in 1m3s, 891.3 files/s)
[start] 2025/03/23 10:15:04 INFO: Migrating folder w3ejt-fn4dm... (66000 files and 5572k blocks in 1m14s, 884.9 files/s)
[start] 2025/03/23 10:15:14 INFO: Migrating folder w3ejt-fn4dm... (76000 files and 6191k blocks in 1m25s, 892.9 files/s)
[start] 2025/03/23 10:15:25 INFO: Migrating folder w3ejt-fn4dm... (87000 files and 6812k blocks in 1m35s, 909.2 files/s)
[start] 2025/03/23 10:15:35 INFO: Migrating folder w3ejt-fn4dm... (96000 files and 7544k blocks in 1m46s, 902.1 files/s)
[start] 2025/03/23 10:15:43 INFO: Migrated folder w3ejt-fn4dm; 101908 files and 8093k blocks in 1m54s, 892.4 files/s
[start] 2025/03/23 10:15:43 INFO: Migrating virtual mtimes...
[start] 2025/03/23 10:15:43 INFO: Migration complete, 188733 files and 11605k blocks in 2m38s

My laptop is more or less the same; I think it has potential to be much faster, but macOS is fanatic about putting server processes on the efficiency cores and limiting their energy consumption etc…

[start] 2025/03/23 11:13:16 INFO: syncthing v2.0.0-beta.9.dev.4.gfdfa19fc-sqlite "Hafnium Hornet" (go1.24.1 darwin-arm64) jb@jbo2.local 2025-03-23 10:02:01 UTC [stnoupgrade]
[start] 2025/03/23 11:13:16 INFO: Migrating old-style database to SQLite; this may take a while...
[start] 2025/03/23 11:13:16 INFO: Migrated folder 7ojpy-cfjhl; 11 files and 1k blocks in 0s, 1951.1 files/s
[start] 2025/03/23 11:13:16 INFO: Migrated folder f3g2c-xkhxh; 2408 files and 12k blocks in 0s, 9878.0 files/s
[start] 2025/03/23 11:13:17 INFO: Migrated folder kzjer-zz3bg; 4687 files and 146k blocks in 0s, 5612.3 files/s
[start] 2025/03/23 11:13:21 INFO: Migrated folder marir-bw9mx; 1591 files and 1312k blocks in 4s, 378.2 files/s
[start] 2025/03/23 11:13:27 INFO: Migrated folder ml3yu-v9kaa; 3053 files and 1133k blocks in 5s, 550.8 files/s
[start] 2025/03/23 11:13:30 INFO: Migrated folder p3jms-73gps; 2492 files and 410k blocks in 2s, 883.4 files/s
[start] 2025/03/23 11:13:31 INFO: Migrated folder rmvlx-cekie; 4861 files and 99k blocks in 1s, 4005.4 files/s
[start] 2025/03/23 11:13:31 INFO: Migrated folder rozef-xd4qh; 5 files and 8k blocks in 0s, 80.6 files/s
[start] 2025/03/23 11:13:34 INFO: Migrated folder smaoh-2qdsh; 5016 files and 254k blocks in 2s, 2042.5 files/s
[start] 2025/03/23 11:13:39 INFO: Migrated folder uk9gc-dkerd; 62701 files and 131k blocks in 5s, 10831.8 files/s
[start] 2025/03/23 11:13:50 INFO: Migrating folder w3ejt-fn4dm... (16000 files and 1334k blocks in 10s, 1547.9 files/s)
[start] 2025/03/23 11:14:00 INFO: Migrating folder w3ejt-fn4dm... (28000 files and 2254k blocks in 20s, 1361.7 files/s)
[start] 2025/03/23 11:14:10 INFO: Migrating folder w3ejt-fn4dm... (39000 files and 3161k blocks in 30s, 1264.3 files/s)
[start] 2025/03/23 11:14:21 INFO: Migrating folder w3ejt-fn4dm... (44000 files and 3872k blocks in 41s, 1062.0 files/s)
[start] 2025/03/23 11:14:31 INFO: Migrating folder w3ejt-fn4dm... (54000 files and 4581k blocks in 51s, 1048.3 files/s)
[start] 2025/03/23 11:14:42 INFO: Migrating folder w3ejt-fn4dm... (63000 files and 5327k blocks in 1m2s, 1009.4 files/s)
[start] 2025/03/23 11:14:53 INFO: Migrating folder w3ejt-fn4dm... (72000 files and 5971k blocks in 1m13s, 979.6 files/s)
[start] 2025/03/23 11:15:04 INFO: Migrating folder w3ejt-fn4dm... (79000 files and 6394k blocks in 1m24s, 931.4 files/s)
[start] 2025/03/23 11:15:15 INFO: Migrating folder w3ejt-fn4dm... (89000 files and 6908k blocks in 1m36s, 925.6 files/s)
[start] 2025/03/23 11:15:27 INFO: Migrating folder w3ejt-fn4dm... (95000 files and 7443k blocks in 1m47s, 881.5 files/s)
[start] 2025/03/23 11:15:38 INFO: Migrating folder w3ejt-fn4dm... (99000 files and 7821k blocks in 1m58s, 833.4 files/s)
[start] 2025/03/23 11:15:44 INFO: Migrated folder w3ejt-fn4dm; 101908 files and 8093k blocks in 2m4s, 816.0 files/s
[start] 2025/03/23 11:15:44 INFO: Migrating virtual mtimes...
[start] 2025/03/23 11:15:45 INFO: Migration complete, 188733 files and 11605k blocks in 2m28s

Sizes:

jb@jbo2:..thing/syncthing/test % du -sh h1/index-v*
1.2G	h1/index-v0.14.0.db-migrated
2.5G	h1/index-v2.db

(Test db with only local files, it’d grow when also adding peers that announce their stuff)

1 Like