#941825 syncthing: 2Gb index-v0.14.0.db

Package:
syncthing
Source:
syncthing
Description:
decentralized file synchronization
Submitter:
sergio
Date:
2022-05-28 17:06:06 UTC
Severity:
normal
Tags:
#941825#5
Date:
2019-10-06 01:28:03 UTC
From:
To:
Dear Maintainer,

% du -sh .config/syncthing/index-v0.14.0.db
2.2G	.config/syncthing/index-v0.14.0.db

% ls -1 .config/syncthing/index-v0.14.0.db | wc -l
938

#941825#10
Date:
2020-04-07 15:26:23 UTC
From:
To:
Hi Sergio,

Thank you for the bug report, reply follows inline:

It's not yet possible to say if this is a regression, so I've tagged
this bug "moreinfo".  With syncthing 1.0.0~ds1-1+b11 I get:

  $ du -hc ~/.config/syncthing/index-v0.14.0.db/
  385M    index-v0.14.0.db/

  $ ls -1 .config/syncthing/index-v0.14.0.db | wc -l
  228

  $ du -hc big-dir0 big-dir1 # There are more, but these are the big ones
  37G     total

  $ find big-dir0 big-dir1 | wc -l
  507138

Please provide similar info, because it may be that your dataset is so
large and has so many files that a 2.2G index is normal :-)  The
maintainer of this package might also ask you to enable Syncthing's
collection of stats, and to provide those--but I'm not sure if those
are required, and I wouldn't enable any of them unless asked.

Regards,
Nicholas

#941825#17
Date:
2020-04-07 15:26:23 UTC
From:
To:
Hi Sergio,

Thank you for the bug report, reply follows inline:

It's not yet possible to say if this is a regression, so I've tagged
this bug "moreinfo".  With syncthing 1.0.0~ds1-1+b11 I get:

  $ du -hc ~/.config/syncthing/index-v0.14.0.db/
  385M    index-v0.14.0.db/

  $ ls -1 .config/syncthing/index-v0.14.0.db | wc -l
  228

  $ du -hc big-dir0 big-dir1 # There are more, but these are the big ones
  37G     total

  $ find big-dir0 big-dir1 | wc -l
  507138

Please provide similar info, because it may be that your dataset is so
large and has so many files that a 2.2G index is normal :-)  The
maintainer of this package might also ask you to enable Syncthing's
collection of stats, and to provide those--but I'm not sure if those
are required, and I wouldn't enable any of them unless asked.

Regards,
Nicholas

#941825#22
Date:
2020-04-07 15:54:57 UTC
From:
To:
Two related comments, though about versions from the future :) :
 - In 1.3.0 new db settings were introduced, which didn't work on 32bit
arches, resulting in huge databases. Was fixed in 1.3.1 (aka please skip
packaging 1.3.0).
 - In 1.4.0 a db optimisation was introduced, that cuts the db size down
a lot.
 - In 1.5.0 there will be an option to store the db in a separate
location. On new installs where XDG_HOME_DIR is set or
~/.local/share/syncthing exists, those directories will be used by default.

And a general note: There are no reports upstream of unusually large
databases. And 2GB isn't unreasonable given sufficiently large synced
folders. Pre 1.4.0 my db was ~1.5GB for ~500GB, 1e6 items.

#941825#27
Date:
2020-04-18 13:13:53 UTC
From:
To:
I removed index so it has been rebuilded:

% du -h ~/.config/syncthing/index-v0.14.0.db
33M	/home/sergio/.config/syncthing/index-v0.14.0.db

ls -1 .config/syncthing/index-v0.14.0.db | wc -l
21

% du -sh local/knot/
11G	local/knot/

% find local/knot/ | wc -l
1140

#941825#32
Date:
2020-04-18 13:13:53 UTC
From:
To:
I removed index so it has been rebuilded:

% du -h ~/.config/syncthing/index-v0.14.0.db
33M	/home/sergio/.config/syncthing/index-v0.14.0.db

ls -1 .config/syncthing/index-v0.14.0.db | wc -l
21

% du -sh local/knot/
11G	local/knot/

% find local/knot/ | wc -l
1140

#941825#37
Date:
2022-05-28 17:01:18 UTC
From:
To:
Hi Sergio,

First, sorry it took me so long to follow up on this bug!  [this reply
has been sitting in my drafts folder for almost two years :/]

With the info you've provided it looks like the issue has been resolved.
Rebuilding the index was a good idea :-) That said, did the problem ever
come back, or do you think it was fixed as early as Syncthing
1.1.4~ds1-5 ?

If it came back, but then went away again, then maybe this bug can be
closed as fixed with 1.12.1~ds1-4, or possibly as late as 1.18.6~ds1-1.
If I remember correctly there was another round of database
optimisations and fixes in between these two versions.

Regards,
Nicholas