Skip to content

lib/config, lib/model: Limit concurrent pulls (fixes #5914) - #6290

Merged
calmh merged 9 commits into
syncthing:masterfrom
calmh:pulllimit
Jan 27, 2020
Merged

calmh merged 9 commits into
syncthing:masterfrom
calmh:pulllimit

Conversation

@calmh

@calmh calmh commented Jan 23, 2020 •

Copy link
Copy Markdown
Member

Purpose

Adds a new folder state "Waiting to Sync" in the same vein as the existing "Waiting to Scan". This vastly improves performances in the rare cases when there are lots and lots of folders operating.

I also changed the default zero value to mean "limit to num-cpu-cores" instead of "no limit".

Testing

I've run it a bunch and looked in the GUI...

calmh added 4 commits January 23, 2020 13:22
Adds a new folder state "Waiting to Sync" in the same vein as the
existing "Waiting to Scan". This vastly improves performances in the
rare cases when there are lots and lots of folders operating.

@AudriusButkevicius AudriusButkevicius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm in principle.

Comment thread gui/default/index.html Resolved
Comment thread gui/default/index.html Resolved
Comment thread lib/config/config_test.go
cfgFile := fmt.Sprintf("testdata/v%d.xml", i)
if _, err := os.Stat(cfgFile); os.IsNotExist(err) {
continue
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also get rid of the noop files that we've produced over the years.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅

// If a value is set, trust that.
if opts.MaxConcurrentFolders > 0 {
return opts.MaxConcurrentFolders
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you want people to set it to 999 for "unlimited"?

@calmh calmh Jan 24, 2020 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was intending -1 to mean unlimited as usual, but I see now that I didn't implement that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ fixed

Comment thread test/folders.sh
<device id="MRIW7OK-NETT3M4-N6SBWME-N25O76W-YJKVXPH-FUMQJ3S-P57B74J-GBITBAC" introducedBy=""></device>
</folder>
EOT
done No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this?

@calmh calmh Jan 24, 2020 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny script to generate lots of folder entries for testing; I had to write it several times so thought I might as well check it in 🤷‍♂

Comment thread lib/config/optionsconfiguration.go Resolved
Comment thread lib/model/folder.go Resolved
Comment thread lib/config/optionsconfiguration.go Resolved
imsodin
imsodin previously approved these changes Jan 27, 2020
Comment thread lib/config/optionsconfiguration.go Outdated
DefaultFolderPath string `xml:"defaultFolderPath" json:"defaultFolderPath" default:"~"`
SetLowPriority bool `xml:"setLowPriority" json:"setLowPriority" default:"true"`
MaxConcurrentScans int `xml:"maxConcurrentScans" json:"maxConcurrentScans"`
RawMaxConcurrentFolders int `xml:"maxConcurrentFolders" json:"maxConcurrentFolders"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MaxFolderConcurrency? Current one reads badly and doesn't really explain what it does. Feels like a limit of how many folders I can have.

@AudriusButkevicius AudriusButkevicius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming nitpick, otherwise, lgtm

@calmh

calmh commented Jan 27, 2020

Copy link
Copy Markdown
Member Author

Valid point, I fix

@calmh
calmh dismissed stale reviews from AudriusButkevicius and imsodin via 92ede6c January 27, 2020 16:24
@calmh
calmh merged commit d91c4b0 into syncthing:master Jan 27, 2020
@calmh
calmh deleted the pulllimit branch January 27, 2020 16:31
@calmh calmh added this to the v1.4.0 milestone Jan 27, 2020
calmh added a commit to calmh/syncthing that referenced this pull request Jan 30, 2020
* master: (28 commits)
  gui, man, authors: Update docs, translations, and contributors
  lib/config, lib/model: Limit concurrent pulls (fixes syncthing#5914) (syncthing#6290)
  lib/db: Fixup last commit with better key name
  lib/db: Configurable block GC time (syncthing#6295)
  lib/db: Deduplicate block lists in database (fixes syncthing#5898) (syncthing#6283)
  lib/relays: Fix incorrect timeout, bring back logging (ref syncthing#6289) (syncthing#6291)
  gui, man, authors: Update docs, translations, and contributors
  all: Transactionalize db.FileSet (fixes syncthing#5952) (syncthing#6239)
  lib/model: Handle progress emitter zero interval (fixes syncthing#6281) (syncthing#6282)
  build(deps): bump github.com/pkg/errors from 0.9.0 to 0.9.1 (syncthing#6279)
  cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes syncthing#5786) (syncthing#6278)
  lib/syncthing: Wait for actual termination on Stop() (syncthing#6277)
  lib/model: Remove legacy handling of symlinks (syncthing#6276)
  lib/model: Return paused summary instead of error on paused folders (syncthing#6272)
  lib/config: Add some info to the folder marker missing (ref syncthing#5207) (syncthing#6270)
  assets, gui: Losslessly compress all JPG, PNG, and PDF images (syncthing#6265)
  cmd/strelaypoolsrv: Serve gzip compressed responses
  gui, man, authors: Update docs, translations, and contributors
  gui, man, authors: Update docs, translations, and contributors
  build: go mod tidy
  ...
calmh added a commit to calmh/syncthing that referenced this pull request Jan 30, 2020
* master: (32 commits)
  gui, man, authors: Update docs, translations, and contributors
  lib/config, lib/model: Limit concurrent pulls (fixes syncthing#5914) (syncthing#6290)
  lib/db: Fixup last commit with better key name
  lib/db: Configurable block GC time (syncthing#6295)
  lib/db: Deduplicate block lists in database (fixes syncthing#5898) (syncthing#6283)
  lib/relays: Fix incorrect timeout, bring back logging (ref syncthing#6289) (syncthing#6291)
  gui, man, authors: Update docs, translations, and contributors
  all: Transactionalize db.FileSet (fixes syncthing#5952) (syncthing#6239)
  lib/model: Handle progress emitter zero interval (fixes syncthing#6281) (syncthing#6282)
  build(deps): bump github.com/pkg/errors from 0.9.0 to 0.9.1 (syncthing#6279)
  cmd/syncthing: Always use monitor process (fixes syncthing#4774, fixes syncthing#5786) (syncthing#6278)
  lib/syncthing: Wait for actual termination on Stop() (syncthing#6277)
  lib/model: Remove legacy handling of symlinks (syncthing#6276)
  lib/model: Return paused summary instead of error on paused folders (syncthing#6272)
  lib/config: Add some info to the folder marker missing (ref syncthing#5207) (syncthing#6270)
  assets, gui: Losslessly compress all JPG, PNG, and PDF images (syncthing#6265)
  cmd/strelaypoolsrv: Serve gzip compressed responses
  gui, man, authors: Update docs, translations, and contributors
  gui, man, authors: Update docs, translations, and contributors
  build: go mod tidy
  ...
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jan 27, 2021
@syncthing syncthing locked and limited conversation to collaborators Jan 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants