address database upgrade slowness (#107)

* give a rule of thumb for update time in the documentation
* log the SQLite3 version, which can affect performance
* do the vacuum in non-WAL mode, to correctly set the page size and to
  avoid very slow behavior on older SQLite3 versions. Larger page sizes
  are generally faster (including subsequent vacuum operations).
  This won't help much for the first vacuum after this change, but it
  will help afterward.
* likewise, set the page size properly on "moonfire-nvr init".
This commit is contained in:
Scott Lamb
2021-02-10 21:44:06 -08:00
parent 4e67af9909
commit ff1615a0b4
4 changed files with 27 additions and 8 deletions

View File

@@ -84,7 +84,10 @@ $ nvr pull # updates the docker image to the latest binary
$ nvr upgrade # runs the upgrade
```
You can run the system in read-only mode, although you'll find this only
As a rule of thumb, on a Raspberry Pi 4 with a 1 GiB database, an upgrade might
take about four minutes for each schema version and for the final vacuum.
Next, you can run the system in read-only mode, although you'll find this only
works in the "insecure" setup. (Authorization requires writing the database.)
```