Skip to content

Allow configuring daemon QoS to avoid slow large-folder scans #293

Description

@robios

Problem

The macOS wrapper currently launches the managed Syncthing process with
Process.qualityOfService = .background.

On a Mac with a large Syncthing folder, this can make full folder scans much
slower than expected:

  • macOS 15.6, Apple M2 Max
  • Syncthing v2.1.2
  • about 393,000 local files and 81,000 directories (107 GB)
  • full scan through POST /rest/db/scan: about 604 seconds with background QoS

CPU, filesystem, ignore patterns, Syncthing's setLowPriority, GC behavior,
SQLite query plans, and database size were investigated without explaining the
slowdown. Rebuilding the wrapper with .default QoS made the scan dramatically
faster in normal use. .utility is also fast enough on the same system while
retaining reduced resource usage.

This is separate from Syncthing's setLowPriority option. That option changed
the process nice value but only changed the measured scan time by about 5%.

Proposal

Add a preference for the managed Syncthing process QoS:

  • Normal (QualityOfService.default)
  • Utility (QualityOfService.utility)
  • Background (QualityOfService.background)

Changing the preference should restart the managed Syncthing process, as the
QoS is applied when the process is launched.

For compatibility, an unset or unrecognized preference should continue to use
Background, preserving the current behavior for existing installations.

Additional context

This preference would keep the wrapper's current low-impact default while
giving users with large folders a way to avoid severe background scheduling
throttling. A draft implementation and further real-world testing will follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions