chore(config): increase max concurrent writes default (#10200)
I lately wanted some photos on my phone, and watched them sync excrutiatingly slowly. I am used to android being slow, but not that slow. This restriction caught my eye and I increased it beyond the limit (didn't spot it at first), and I did see a clear improvement. Of course as always with such a one-off test, I might also have hallucinated it, but it seems plausible with the slow thing in android being some layer between the actual filesystem and apps. Also increase the max limit, mostly just because I don't see any reason to restrict it that low - not that I have a particular reason to want more. I also changed the xml default to 0: The `prepare` code will change it to the actual default - no need to change that anymore if we change the default in the future.
This commit is contained in:
@@ -31,7 +31,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
OldestHandledVersion = 10
|
OldestHandledVersion = 10
|
||||||
CurrentVersion = 50
|
CurrentVersion = 51
|
||||||
MaxRescanIntervalS = 365 * 24 * 60 * 60
|
MaxRescanIntervalS = 365 * 24 * 60 * 60
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ func TestDefaultValues(t *testing.T) {
|
|||||||
},
|
},
|
||||||
MaxConflicts: 10,
|
MaxConflicts: 10,
|
||||||
MarkerName: ".stfolder",
|
MarkerName: ".stfolder",
|
||||||
MaxConcurrentWrites: 2,
|
MaxConcurrentWrites: maxConcurrentWritesDefault,
|
||||||
XattrFilter: XattrFilter{
|
XattrFilter: XattrFilter{
|
||||||
Entries: []XattrFilterEntry{},
|
Entries: []XattrFilterEntry{},
|
||||||
MaxSingleEntrySize: 1024,
|
MaxSingleEntrySize: 1024,
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ var (
|
|||||||
const (
|
const (
|
||||||
DefaultMarkerName = ".stfolder"
|
DefaultMarkerName = ".stfolder"
|
||||||
EncryptionTokenName = "syncthing-encryption_password_token" //nolint: gosec
|
EncryptionTokenName = "syncthing-encryption_password_token" //nolint: gosec
|
||||||
maxConcurrentWritesDefault = 2
|
maxConcurrentWritesDefault = 16
|
||||||
maxConcurrentWritesLimit = 64
|
maxConcurrentWritesLimit = 256
|
||||||
)
|
)
|
||||||
|
|
||||||
type FolderDeviceConfiguration struct {
|
type FolderDeviceConfiguration struct {
|
||||||
@@ -76,7 +76,7 @@ type FolderConfiguration struct {
|
|||||||
MarkerName string `json:"markerName" xml:"markerName"`
|
MarkerName string `json:"markerName" xml:"markerName"`
|
||||||
CopyOwnershipFromParent bool `json:"copyOwnershipFromParent" xml:"copyOwnershipFromParent"`
|
CopyOwnershipFromParent bool `json:"copyOwnershipFromParent" xml:"copyOwnershipFromParent"`
|
||||||
RawModTimeWindowS int `json:"modTimeWindowS" xml:"modTimeWindowS"`
|
RawModTimeWindowS int `json:"modTimeWindowS" xml:"modTimeWindowS"`
|
||||||
MaxConcurrentWrites int `json:"maxConcurrentWrites" xml:"maxConcurrentWrites" default:"2"`
|
MaxConcurrentWrites int `json:"maxConcurrentWrites" xml:"maxConcurrentWrites" default:"0"`
|
||||||
DisableFsync bool `json:"disableFsync" xml:"disableFsync"`
|
DisableFsync bool `json:"disableFsync" xml:"disableFsync"`
|
||||||
BlockPullOrder BlockPullOrder `json:"blockPullOrder" xml:"blockPullOrder"`
|
BlockPullOrder BlockPullOrder `json:"blockPullOrder" xml:"blockPullOrder"`
|
||||||
CopyRangeMethod CopyRangeMethod `json:"copyRangeMethod" xml:"copyRangeMethod" default:"standard"`
|
CopyRangeMethod CopyRangeMethod `json:"copyRangeMethod" xml:"copyRangeMethod" default:"standard"`
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import (
|
|||||||
// put the newest on top for readability.
|
// put the newest on top for readability.
|
||||||
var (
|
var (
|
||||||
migrations = migrationSet{
|
migrations = migrationSet{
|
||||||
|
{51, migrateToConfigV51},
|
||||||
{50, migrateToConfigV50},
|
{50, migrateToConfigV50},
|
||||||
{37, migrateToConfigV37},
|
{37, migrateToConfigV37},
|
||||||
{36, migrateToConfigV36},
|
{36, migrateToConfigV36},
|
||||||
@@ -98,6 +99,18 @@ func (m migration) apply(cfg *Configuration) {
|
|||||||
cfg.Version = m.targetVersion
|
cfg.Version = m.targetVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func migrateToConfigV51(cfg *Configuration) {
|
||||||
|
oldDefault := 2
|
||||||
|
for i, fcfg := range cfg.Folders {
|
||||||
|
if fcfg.MaxConcurrentWrites == oldDefault {
|
||||||
|
cfg.Folders[i].MaxConcurrentWrites = maxConcurrentWritesDefault
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if cfg.Defaults.Folder.MaxConcurrentWrites == oldDefault {
|
||||||
|
cfg.Defaults.Folder.MaxConcurrentWrites = maxConcurrentWritesDefault
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func migrateToConfigV50(cfg *Configuration) {
|
func migrateToConfigV50(cfg *Configuration) {
|
||||||
// v50 is Syncthing 2.0
|
// v50 is Syncthing 2.0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user