lib/db: Add hacky way to adjust database parameters (#5889)
lib/db: Add hacky way to adjust database parameters (#5889)

This adds a set of magical environment variables that can be used to
tweak the database parameters. It's totally undocumented and not
intended to be a long term or supported thing.

It's ugly, but there is a backstory. I have a couple of large
installations where the database options are inefficient or otherwise
suboptimal (24/7 compaction going on and stuff like that). I don't
*know* the correct database parameters, nor yet the formula or method to
derive them by, so this requires experimentation. Experimentation needs
to happen partly in production, and rolling out new builds for every
tweak isn't practical. This provides override points for all reasonable
values, while not changing anything by default.

Ideally, at the end of such experimentation, we'll know which values are
relevant to change and in what manner, and can provide a more user
friendly knob to do so - or do it automatically based on the database
size.

imsodin/syncthing,imsodin/syncthing,AudriusButkevicius/syncthing,imsodin/syncthing,wweich/syncthing,syncthing/syncthing,AudriusButkevicius/syncthing,syncthing/syncthing,syncthing/syncthing,syncthing/syncthing,wweich/syncthing,syncthing/syncthing,wweich/syncthing,syncthing/syncthing,AudriusButkevicius/syncthing,imsodin/syncthing,AudriusButkevicius/syncthing,wweich/syncthing,imsodin/syncthing