mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
webdav: make pacer minSleep configurable
This adds the config argument --webdav-pacer-min-sleep which specifies the http-request rate limit. Lowering this from the default 10ms can greatly improve performance when synchronizing small files. See: https://forum.rclone.org/t/webdav-with-persistent-connections/37024/10
This commit is contained in:
parent
8fb9eb2fee
commit
3f0bec2ee9
@ -43,7 +43,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
minSleep = 10 * time.Millisecond
|
||||
minSleep = fs.Duration(10 * time.Millisecond)
|
||||
maxSleep = 2 * time.Second
|
||||
decayConstant = 2 // bigger for slower decay, exponential
|
||||
defaultDepth = "1" // depth for PROPFIND
|
||||
@ -128,6 +128,11 @@ You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'
|
||||
`,
|
||||
Default: fs.CommaSepList{},
|
||||
Advanced: true,
|
||||
}, {
|
||||
Name: "pacer_min_sleep",
|
||||
Help: "Minimum time to sleep between API calls.",
|
||||
Default: minSleep,
|
||||
Advanced: true,
|
||||
}, {
|
||||
Name: "nextcloud_chunk_size",
|
||||
Help: `Nextcloud upload chunk size.
|
||||
@ -153,6 +158,7 @@ type Options struct {
|
||||
BearerTokenCommand string `config:"bearer_token_command"`
|
||||
Enc encoder.MultiEncoder `config:"encoding"`
|
||||
Headers fs.CommaSepList `config:"headers"`
|
||||
PacerMinSleep fs.Duration `config:"pacer_min_sleep"`
|
||||
ChunkSize fs.SizeSuffix `config:"nextcloud_chunk_size"`
|
||||
}
|
||||
|
||||
@ -430,7 +436,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
opt: *opt,
|
||||
endpoint: u,
|
||||
endpointURL: u.String(),
|
||||
pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))),
|
||||
pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(opt.PacerMinSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))),
|
||||
precision: fs.ModTimeNotSupported,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user