Skip to content

strelaysrv: -per-session-rate parameter seems to not be working as expected #10072

Closed

Description

@szu17dmy

What happened?

Hi everyone,

Our team has been utilizing Syncthing and recently started exploring the -per-session-rate parameter to manage bandwidth more granularly.

Our understanding is that -per-session-rate should cap each individual device pair's connection speed, but the aggregate speed across all connections could exceed this limit.

However, we've encountered behavior where the total aggregate transfer rate seems to be unexpectedly capped at the value set by -per-session-rate, even when multiple peers are actively syncing. We wanted to inquire if this is expected or if we might be seeing an issue.

Actual Observed Behavior

Below (or attached) is a screenshot from our monitoring of the relay server's network traffic during a relevant period. During this time, the strelaysrv instance was running with parameters including -global-rate=50000000 and -per-session-rate=6250000.

Image

50000000bytes/s == 50000KB/s == 50MB/s == 400Mbps; approx.
6250000bytes/s == 6250KB/s == 6.25MB/s == 50Mbps; approx.

Expected Behavior

We expected each individual session (e.g., A<->B, C<->D) to be independently capped at approximately 50Mbps.

We expected the total aggregate transfer rate for them to be the sum of the active session rates, potentially reaching up to 400Mbps if connected to more peers.

Our Questions

Based on our observations, and after a preliminary review of the relevant code sections, it appears the rate limiter instance associated with the -per-session-rate parameter in strelaysrv might be implemented as a single, shared instance across all relayed sessions, rather than as distinct limiters created per session. Could you please confirm if this understanding of the current implementation is accurate?

sessionLimiter *rate.Limiter

Thanks.

Syncthing version

v1.22.1, no related changes were made after this version

Platform & operating system

Linux amd64

Browser version

No response

Relevant log output

Activity

  1. added
    bug
    needs-triage
    on Apr 27, 2025
  2. szu17dmy commented on Apr 27, 2025

    @szu17dmy
    ContributorAuthor

    Please check #10073

  3. added a commit that references this issue on Apr 30, 2025
    0bf21d9
  4. added 3 commits that reference this issue on Apr 30, 2025
    2159dfd
    5833d60
    a62a24e
  5. added this to the v1.29.6 milestone on May 6, 2025
  6. added
    frozen-due-to-age
    on Jul 1, 2026
  7. locked and limited conversation to collaborators on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfrozen-due-to-ageneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions