Priority not set to normal with setLowPriority set to false

I changed setLowPriority from true to false in config.xml (system wide install, thus config is in C:\ProgramData\Syncthing). But the syncthing tasks have priority “Below normal” not “Normal”.

This may be obvious, but have you restarted Syncthing completely after doing so? If yes, then maybe check if Syncthing is started via the Task Scheduler. If that’s the case, then the lower priority is expected, as all scheduled tasks have their priority set to 7 by default (see https://learn.microsoft.com/windows/win32/taskschd/taskschedulerschema-priority-settingstype-element for details). The only way to change that is to export the task to XML, edit the priority manually in the XML file, and then import it into the Task Scheduler again. There’s no way to do it in the GUI.

I installed Syncthing using the Windows setup, which seems to automatically do something with the task scheduler if you check it during installation. Is the config.xml file ignored for task scheduler tasks? Or does setting setLowPriority to false mean it keeps the default 7?

If Syncthing is started by the Task Scheduler with a lower priority, then enabling or disabling setLowPriority in the config.xml won’t matter, as the process will already be set to “below normal” priority beforehand.

I added a shortcut as well to C:\Windows\System32\sc.exe start syncthing. Is there any way to add a priority to that?

I am wondering why you would want Syncthing to run at “normal” rather than “below normal” priority?

To add on to this discussion:

Syncthing Windows Setup configures the setLowPriority setting in config.xml to false. It does this so that it can start syncthing.exe (either as a scheduled task or as a service) with a custom priority.

If you install in non administrative (per user) installation mode and choose to start Syncthing at logon, Syncthing Windows Setup creates a scheduled task that starts Syncthing using the stctl utility. The stctl utility starts Syncthing with “below normal” process priority.

If you install in administrative (per computer) installation mode, Syncthing Windows Setup runs Syncthing as a service using shawl and includes --priority below-normal on the shawl command line to run the service at “below normal” process priority.

If you installed Syncthing using Syncthing Windows Setup v1.27.28 or older in non administrative (per user) installation mode, you can use a custom process priority by doing the following:

  1. Download stctl v0.0.4 (or later), and replace the installed copy of stctl.exe with the one from the download.
  2. Update the scheduled task that starts Syncthing at logon, and add -p priority to the argument list in the task’s action (where priority is one of: normal, idle, high, belownormal, or abovenormal)

(The next version of Syncthing Windows Setup will include the updated version of the stctl tool.)

If you installed Syncthing using Syncthing Windows Setup in administrative (per computer) installation mode and you want to use a custom process priority, do the following:

  1. Open the Windows Registry Editor
  2. Navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\syncthing subkey
  3. In the ImagePath value, update the argument after the --priority parameter to one of the following: high, above-normal, normal, below-normal, or idle
  4. Restart the service

It seems to me that “below normal” is a very sensible default process priority for the vast majority of use cases, so I don’t see a need to add yet another installer configuration option to change the default.

1 Like

I used to have a shortcut to Syncthing in the “Start up” folder, but that stopped working as I switched to Windows 11 because of the terminal app. I had it configured to set the priority to normal there instead of below normal.

The problem with below normal priority is that it takes very long to synchronize sometimes, even with global discovery turned off and relaying disabled.

The problem with below normal priority is that it takes very long to synchronize sometimes, even with global discovery turned off and relaying disabled.

FWIW, I’ve never noticed any issues using below normal process priority. Are you saying that your problem disappears when you use normal (instead of below normal) priority?

1 Like

The priority should only matter if you’ve got other applications running that utilise the CPU heavily (and only the CPU, as this specific priority in Windows doesn’t affect I/O or RAM access at all). For example, if you’re rendering something or compiling a piece of code, and the CPU is pegged at 100% by those, then yes, Syncthing will have to wait for them to finish to actually be able to do its job. Otherwise, changing the priority shouldn’t make much difference.

3 Likes

The priority should only matter if you’ve got other applications running that utilise the CPU heavily (and only the CPU, as this specific priority in Windows doesn’t affect I/O or RAM access at all).

Yes; this is why I would be surprised if setting normal process priority had any impact on the OP’s problem.