[Request] Schedule-based connection speed limits

Something that I think would be useful would be an ability to have different connection speed limits on a schedule… something like “limit traffic to X kbps during these hours, unlimited speed during these hours”. When transferring large files, it’s easy to let Syncthing saturate my Internet connection, so I have to adjust the incoming connection speed during business hours, either in the GUI or through the API. However at night I then remove the connection speed limit to let traffic flow unrestricted. Some form of built in support for that would be helpful, although maybe not to a large audience.

1 Like

The API is your oyster.

Hi Ryan

I have this same requirement. Did you get anywhere with a workaround or solution?

I have seen people asking for it but the proposed solutions tend to require scripted use of the API, etc, and they tend to look beyond my current level of technical ability.

I see that Resilio Sync has implemented this feature in its Home PRO version so am wondering if this may be my best option.

Thoughts or comments?

Thank you

Mark

Cooking recipe:

  • install syncthing.exe as service “syncthing”
  • load unixtools sed.exe to c:\windows
  • add a scheduled job to cron/windows scheduler
  • execute batch in job
  • net stop syncthing
  • sed -i -e s/Limit…=0/Limit…=100000/gI config.xml
  • net start syncthing

You can pass the limit as a command line parameter from the scheduled job. Have one job on the limit start hour and one job on the end hour to reset back to 0 ( = unlimited ).

1 Like

Or just use curl and jq with the REST Api, which will not force a complete rescan and will not close any connections:

curl -s -X GET -H 'X-API-Key: {api-key}' http://localhost:8384/rest/system/config | jq '.options.maxSendKbps = 1024 | .options.maxRecvKbps = 2048' | curl -s -X POST -H 'X-API-Key: {api-key}' http://localhost:8384/rest/system/config -d @-

not tested on Windows

https://curl.haxx.se/windows/
https://stedolan.github.io/jq/download/

You can even control these using the new cli

@wweich, this works like a charm. A thousand thank-you’s.

I tweaked the command line you provided, put it into two script files (one to increase receive rate, one to decrease) and then simply set the Synology Task Scheduler to execute each script at the right time of day.

Bingo!

Thank you again.