lib/db: Use different defaults for larger databases (fixes #5966) (#5967)

This introduces a better set of defaults for large databases. I've
experimentally determined that it results in much better throughput in a
couple of scenarios with large databases, but I can't give any
guarantees the values are always optimal. They're probably no worse than
the defaults though.
This commit is contained in:
Jakob Borg
2019-08-20 09:41:41 +02:00
committed by Simon Frei
parent e910acdc17
commit 90b70c7a16
7 changed files with 174 additions and 18 deletions

26
lib/config/tuning_test.go Normal file
View File

@@ -0,0 +1,26 @@
// Copyright (C) 2019 The Syncthing Authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
package config_test
import (
"testing"
"github.com/syncthing/syncthing/lib/config"
"github.com/syncthing/syncthing/lib/db"
)
func TestTuningMatches(t *testing.T) {
if int(config.TuningAuto) != int(db.TuningAuto) {
t.Error("mismatch for TuningAuto")
}
if int(config.TuningSmall) != int(db.TuningSmall) {
t.Error("mismatch for TuningSmall")
}
if int(config.TuningLarge) != int(db.TuningLarge) {
t.Error("mismatch for TuningLarge")
}
}