diff --git a/advanced/option-database-tuning.rst b/advanced/option-database-tuning.rst
deleted file mode 100644
index c4496da1a..000000000
--- a/advanced/option-database-tuning.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-.. _option-databaseTuning:
-
-databaseTuning
-==============
-
-.. versionadded:: 1.3.0
-
-The ``databaseTuning`` option controls how Syncthing uses the backend
-key-value database that stores the index data and other persistent data
-Syncthing needs. In most cases this database is fairly small (hundred
-megabytes or less) and the default tuning is optimized for this. However in
-cases with large folders or many devices the database may grow, and updates
-may be more frequent. In these cases it's better to use larger buffers,
-allow more memory to be used for cache, allow a larger amount of overhead on
-disk in order to improve compaction performance, and so on.
-
-The ``databaseTuning`` option can have one of three values:
-
-- ``small``: This is the old set of tuning parameters, recommended for small
- databases.
-- ``large``: This is a new set of tuning parameters, recommended for large
- databases.
-
-- ``auto``: Syncthing will automatically use either the large or small
- tuning parameters depending on the database size on disk. A database that is
- 200 MiB or more in size is considered "large" for the purposes of this
- option.
-
-The default value is ``auto``.
diff --git a/includes/env-vars.rst b/includes/env-vars.rst
index e0fa06aeb..c28fcece3 100644
--- a/includes/env-vars.rst
+++ b/includes/env-vars.rst
@@ -8,8 +8,6 @@ STTRACE
Main and operational facilities:
config
Configuration loading and saving.
- db
- The database layer.
main
Main package.
model
@@ -51,6 +49,8 @@ STTRACE
REST API.
sha256
SHA256 hashing package (this facility currently unused).
+ sqlite
+ The SQLite database
stats
Persistent device and folder statistics.
sync
@@ -63,65 +63,14 @@ STTRACE
all
All of the above.
-STBLOCKPROFILE
- Write block profiles to ``block-$pid-$timestamp.pprof`` every 20 seconds.
-
-STCPUPROFILE
- Write a CPU profile to ``cpu-$pid.pprof`` on exit.
-
-STDEADLOCKTIMEOUT
- Used for debugging internal deadlocks; sets debug sensitivity. Use only
- under direction of a developer.
-
STLOCKTHRESHOLD
Used for debugging internal deadlocks; sets debug sensitivity. Use only
under direction of a developer.
-STGUIADDRESS
- Override GUI listen address. Equivalent to passing :option:`--gui-address`.
-
-STGUIAPIKEY
- Override the API key needed to access the GUI / REST API. Equivalent to
- passing :option:`--gui-apikey`.
-
-STGUIASSETS
- Directory to load GUI assets from. Overrides compiled in assets. Useful for
- developing webgui, commonly use ``STGUIASSETS=gui bin/syncthing``.
-
-STHEAPPROFILE
- Write heap profiles to ``heap-$pid-$timestamp.pprof`` each time heap usage
- increases.
-
-STNODEFAULTFOLDER
- Don't create a default folder when starting for the first time. This
- variable will be ignored anytime after the first run. Equivalent to the
- :option:`--no-default-folder` flag.
-
-STNORESTART
- Equivalent to the :option:`--no-restart` flag.
-
-STNOUPGRADE
- Disable automatic upgrades. Equivalent to the :option:`--no-upgrade` flag.
-
-STPROFILER
- Set to a listen address such as "127.0.0.1:9090" to start the profiler with
- HTTP access, which then can be reached at
- http://localhost:9090/debug/pprof. See ``go tool pprof`` for more
- information.
-
-STPERFSTATS
- Write running performance statistics to ``perf-$pid.csv``. Not supported on
- Windows.
-
-STRECHECKDBEVERY
- Time before folder statistics (file, dir, ... counts) are recalculated from
- scratch. The given duration must be parseable by Go's ``time.ParseDuration``. If
- missing or not parseable, the default value of 1 month is used. To force
- recalculation on every startup, set it to ``1s``.
-
-STGCINDIRECTEVERY
- Sets the time interval in between database garbage collection runs. The
- given duration must be parseable by Go's ``time.ParseDuration``.
+STVERSIONEXTRA
+ Add extra information to the version string in logs and the version line
+ in the GUI. Can be set to the name of a wrapper or tool controlling
+ syncthing to communicate this to the end user.
GOMAXPROCS
Set the maximum number of CPU cores to use. Defaults to all available CPU
diff --git a/rest/system-config-get.rst b/rest/system-config-get.rst
index 02723f9c7..b04ed01e4 100644
--- a/rest/system-config-get.rst
+++ b/rest/system-config-get.rst
@@ -171,7 +171,6 @@ Returns the current configuration.
"stunServers": [
"default"
],
- "databaseTuning": "auto",
"maxConcurrentIncomingRequestKiB": 0,
"announceLANAddresses": true,
"sendFullIndexOnUpgrade": false,
diff --git a/rest/system-paths-get.rst b/rest/system-paths-get.rst
index f27f3f321..a9a5aeedd 100644
--- a/rest/system-paths-get.rst
+++ b/rest/system-paths-get.rst
@@ -16,7 +16,7 @@ and others.
"certFile": "/home/user/.config/syncthing/cert.pem",
"config": "/home/user/.config/syncthing/config.xml",
"csrfTokens": "/home/user/.config/syncthing/csrftokens.txt",
- "database": "/home/user/.local/share/syncthing/index-v0.14.0.db",
+ "database": "/home/user/.local/share/syncthing/index-v2.db",
"defFolder": "/home/user/Sync",
"guiAssets": "/home/user/src/syncthing/gui",
"httpsCertFile": "/home/user/.config/syncthing/https-cert.pem",
diff --git a/users/config.rst b/users/config.rst
index 5ea05ca39..40548cc24 100644
--- a/users/config.rst
+++ b/users/config.rst
@@ -64,8 +64,8 @@ corresponding environment variables (``$STDATADIR`` or ``STHOMEDIR``).
The database directory contains the following files, among others:
:file:`index-{*}.db`
- A directory holding the database with metadata and hashes of the files
- currently on disk and available from peers.
+ The database with metadata and hashes of the files currently on disk and
+ available from peers.
:file:`syncthing.log`
Log output, on some systems.
@@ -188,7 +188,6 @@ The following shows an example of a default configuration file (IDs will differ)
180
20
default
- auto
0
true
false
@@ -1048,7 +1047,6 @@ Options Element
180
20
default
- auto
0
true
false
@@ -1300,13 +1298,6 @@ The ``options`` element contains all other global configuration options.
feature. Set ``false`` to keep Syncthing from sending panic logs on serious
troubles. Defaults to ``true``, to help the developers troubleshoot.
-.. option:: options.databaseTuning
-
- Controls how Syncthing uses the backend key-value database that stores the
- index data and other persistent data it needs. The available options and
- implications are explained in a :doc:`separate chapter
- `.
-
.. option:: options.maxConcurrentIncomingRequestKiB
This limits how many bytes we have "in the air" in the form of response data
diff --git a/users/syncing.rst b/users/syncing.rst
index 9d6034556..1e474c9ad 100644
--- a/users/syncing.rst
+++ b/users/syncing.rst
@@ -69,8 +69,8 @@ version of the file. This version is called the *global* version and is the
one that each device strives to be up to date with.
This information is kept in the *index database*, which is stored in the
-configuration directory and called ``index-vx.y.z.db`` (for some version
-x.y.z which may not be exactly the version of Syncthing you're running).
+configuration or data directory and called ``index-*.db``, with some version
+number in place of the asterisk.
When new index data is received from other devices Syncthing recalculates
which version for each file should be the global version, and compares this
diff --git a/users/syncthing.rst b/users/syncthing.rst
index e22e1c9e3..7fa52432e 100644
--- a/users/syncthing.rst
+++ b/users/syncthing.rst
@@ -10,33 +10,60 @@ Synopsis
::
syncthing [serve]
- [--audit] [--auditfile=] [--browser-only] [--device-id]
- [--generate=] [--gui-address=] [--gui-apikey=]
[--home= | --config= --data=]
+ [--allow-newer-config] [--audit] [--auditfile=]
+ [--db-maintenance-interval=]
+ [--db-delete-retention-interval=]
+ [--gui-address=] [--gui-apikey=]
[--logfile=] [--logflags=]
[--log-max-old-files=] [--log-max-size=]
- [--no-browser] [--no-console] [--no-restart] [--paths] [--paused]
- [--no-default-folder] [--skip-port-probing]
- [--reset-database] [--reset-deltas] [--unpaused] [--allow-newer-config]
- [--upgrade] [--no-upgrade] [--upgrade-check] [--upgrade-to=]
+ [--no-browser] [--no-console]
+ [--no-port-probing] [--no-restart] [--no-upgrade]
+ [--paused] [--unpaused]
[--verbose] [--version] [--help] [--debug-*]
- syncthing generate
- [--home= | --config=]
- [--gui-user=] [--gui-password=]
- [--no-default-folder] [--skip-port-probing] [--no-console]
+ syncthing cli
+ [--home= | --config= --data=]
+ [--gui-address=] [--gui-apikey=]
+ [--help]
+ [command options...] [arguments...]
+
+ syncthing browser
+ [--home= | --config= --data=]
[--help]
syncthing decrypt (--to= | --verify-only)
+ [--home= | --config= --data=]
[--password=] [--folder-id=] [--token-path=]
- [--continue] [--verbose] [--version] [--help]
+ [--continue] [--verbose] [--help]
- syncthing cli
+ syncthing device-id
+ [--home= | --config= --data=]
+ [--help]
+
+ syncthing generate
+ [--home= | --config= --data=]
+ [--gui-user=] [--gui-password=]
+ [--no-port-probing]
+ [--help]
+
+ syncthing paths
+ [--home= | --config= --data=]
+ [--help]
+
+ syncthing upgrade
+ [--home= | --config= --data=]
+ [--check-only] [--from=]
+ [--help]
+
+ syncthing version
+ [--home= | --config= --data=]
+ [--help]
+
+ syncthing debug
[--home= | --config= --data=]
- [--gui-address=] [--gui-apikey=]
[--help]
- [command options...] [arguments...]
Description
-----------
@@ -56,8 +83,34 @@ other apps like graphical system integration helpers can use as well, for
greatest flexibility. A link to reach the GUI and API is printed among the first
few log messages.
-Options
--------
+Common options
+--------------
+
+.. cmdoption:: --home=, -H
+
+ Set common configuration and data directory. The default configuration
+ directory is ``$XDG_STATE_HOME/syncthing`` or
+ ``$HOME/.local/state/syncthing`` (Unix-like),
+ ``$HOME/Library/Application Support/Syncthing`` (Mac) and
+ ``%LOCALAPPDATA%\Syncthing`` (Windows).
+
+.. cmdoption:: --config=, -C
+
+ Set configuration directory. Alternative to ``--home`` and must be used
+ together with ``--data``.
+
+.. cmdoption:: --data=, -D
+
+ Set data (e.g. database) directory. Alternative to ``--home`` and must be used
+ together with ``--config``.
+
+.. cmdoption:: --help, -h
+
+ Show help text about command line usage. Context-sensitive depending on the
+ given subcommand.
+
+Serve options
+-------------
.. cmdoption:: --allow-newer-config
@@ -73,17 +126,15 @@ Options
Use specified file or stream (``"-"`` for stdout, ``"--"`` for stderr) for
audit events, rather than the timestamped default file name.
-.. cmdoption:: --browser-only
-
- Open the web UI in a browser for an already running Syncthing instance.
+.. cmdoption:: --db-maintenance-interval=
-.. cmdoption:: --device-id
+ Database maintenance interval -- internal database maintenance routines
+ run this often.
- Print device ID to command line.
+.. cmdoption:: --db-delete-retention-interval=
-.. cmdoption:: --generate=
-
- Generate key and config in specified dir, then exit.
+ Database deleted item retention interval -- deleted items are forgotten
+ from the database after this interval.
.. cmdoption:: --gui-address=
@@ -98,41 +149,6 @@ Options
Override the API key needed to access the GUI / REST API.
-.. cmdoption:: --gui-password=
-
- Specify new GUI authentication password, to update the config file. Read
- from the standard input stream if only a single dash (``-``) is given. A
- plaintext password is hashed before writing to the config file, but an
- already bcrypt-hashed input is stored verbatim. As a special case, giving
- the existing password hash as password will leave it untouched.
-
-.. cmdoption:: --gui-user=
-
- Specify new GUI authentication user name, to update the config file.
-
-.. cmdoption:: --help, -h
-
- Show help text about command line usage. Context-sensitive depending on the
- given subcommand.
-
-.. cmdoption:: --home=
-
- Set common configuration and data directory. The default configuration
- directory is ``$XDG_STATE_HOME/syncthing`` or
- ``$HOME/.local/state/syncthing`` (Unix-like),
- ``$HOME/Library/Application Support/Syncthing`` (Mac) and
- ``%LOCALAPPDATA%\Syncthing`` (Windows).
-
-.. cmdoption:: --config=
-
- Set configuration directory. Alternative to ``--home`` and must be used
- together with ``--data``.
-
-.. cmdoption:: --data=
-
- Set data (e.g. database) directory. Alternative to ``--home`` and must be used
- together with ``--config``.
-
.. cmdoption:: --logfile=
Set destination filename for logging (use ``"-"`` for stdout, which is the
@@ -170,10 +186,10 @@ Options
Hide the console window. (On Windows only)
-.. cmdoption:: --no-default-folder
+.. cmdoption:: --no-port-probing
- Don't create a default folder when generating an initial configuration /
- starting for the first time.
+ Don't try to find unused random ports for the GUI and listen address when
+ generating an initial configuration / starting for the first time.
.. cmdoption:: --no-restart
@@ -185,32 +201,10 @@ Options
Disable automatic upgrades. Equivalent to the ``STNOUPGRADE`` environment
variable, see below.
-.. cmdoption:: --paths
-
- Print the paths used for configuration, keys, database, GUI overrides,
- default sync folder and the log file.
-
.. cmdoption:: --paused
Start with all devices and folders paused.
-.. cmdoption:: --reset-database
-
- Reset the database, forcing a full rescan and resync. Create `.stfolder`
- folders in each sync folder if they do not already exist. **Caution**:
- Ensure that all sync folders which are mountpoints are already mounted.
- Inconsistent versions may result if the mountpoint is later mounted and
- contains older versions.
-
-.. cmdoption:: --reset-deltas
-
- Reset delta index IDs, forcing a full index exchange.
-
-.. cmdoption:: --skip-port-probing
-
- Don't try to find unused random ports for the GUI and listen address when
- generating an initial configuration / starting for the first time.
-
.. cmdoption:: --unpaused
Start with all devices and folders unpaused.
@@ -219,21 +213,12 @@ Options
Perform upgrade.
-.. cmdoption:: --upgrade-check
-
- Check for available upgrade.
-
-.. cmdoption:: --upgrade-to=
-
- Force upgrade directly from specified URL.
-
.. cmdoption:: --verbose
Print verbose log output.
-.. cmdoption:: --version
-
- Show version.
+Decrypt options
+---------------
.. cmdoption:: --to=
@@ -261,6 +246,33 @@ Options
Continue processing next file in case of error, instead of aborting.
+Generate options
+----------------
+
+.. cmdoption:: --gui-password=
+
+ Specify new GUI authentication password, to update the config file. Read
+ from the standard input stream if only a single dash (``-``) is given. A
+ plaintext password is hashed before writing to the config file, but an
+ already bcrypt-hashed input is stored verbatim. As a special case, giving
+ the existing password hash as password will leave it untouched.
+
+.. cmdoption:: --gui-user=
+
+ Specify new GUI authentication user name, to update the config file.
+
+Upgrade options
+---------------
+
+.. cmdoption:: --check-only
+
+ Do not upgrade, only indicate whether an upgrade is available.
+
+.. cmdoption:: --from=
+
+ Upgrade to the Syncthing version available from loading the package at
+ the given URL.
+
Exit Codes
----------
diff --git a/users/tuning.rst b/users/tuning.rst
index cf34b192c..897cdea7f 100644
--- a/users/tuning.rst
+++ b/users/tuning.rst
@@ -32,11 +32,6 @@ is on an SSD. First some general options:
performance. If the underlying storage is a large array of disk,
then syncing many folders concurrently may be beneficial.
-- :opt:`databaseTuning`
- Set to ``large``. Regardless of the size of the actual database, this
- increases a number of buffers and settings to optimize for higher
- throughput.
-
- :opt:`maxConcurrentIncomingRequestKiB`
This sets the maximum amount of data being processed (loaded from
disk and transmitted over the network) concurrently at any given
@@ -152,11 +147,6 @@ General options:
- :opt:`maxFolderConcurrency`
Set to 1 to sync folders sequentially, reducing the peak memory usage.
-- :opt:`databaseTuning`
- Set to ``small``. Regardless of the size of the actual database size,
- this reduces the size of a number of buffers to optimize for reduced
- memory usage.
-
- :opt:`maxConcurrentIncomingRequestKiB`
Set to 32 MiB to reduce the amount of memory used for buffering
responses to incoming requests.