Skip to content

"concurrency: auto" is a hardcoded 4, not adaptive; the name promises something it does not do #156

Description

@eiserv

What

advanced.concurrency and advanced.request_concurrency accept the literal string auto (autoInt in internal/config/configfile.go, and the schema's autoInt definition). auto resolves to a compile-time constant:

defaultConcurrency        = 4
defaultRequestConcurrency = 16

via autoInt.or(def). So auto means "4" and "16", always, on every runner and every link.

Why it matters

Two separate problems, one cosmetic and one real.

The word is misleading. auto promises that easySFTP works something out. It does not; it is a synonym for "unset". docs/configuration.md is honest about it (auto (4)), but a user reading only the config file or the JSON schema reasonably concludes that easySFTP adapts to the runner and does not need tuning. That is exactly the user who will never touch the value and never find out that it was a fixed 4 the whole time.

The fixed value is a poor fit for the spread of environments. A standard hosted runner has 4 vCPUs; a larger runner has 16 or 64. Link characteristics vary far more than that: a deploy to a server one datacentre away and a deploy to shared hosting three continents away want very different amounts of parallelism, and 4 concurrent files with 16 in-flight requests each is conservative for the first and possibly too aggressive for the second.

Suggested direction

Pick one of these deliberately and write down which:

  1. Make auto mean something. For concurrency, deriving from runtime.NumCPU() is easy but wrong-headed: upload parallelism is bounded by the server and the link, not by the runner's CPU. A genuinely adaptive version would ramp concurrency up while throughput improves and back off on errors, which is real work and needs the measurement harness from the benchmarking issue first.
  2. Rename it. default says exactly what it does today and makes no promise. This is the honest, cheap option, at the cost of a config-file compatibility shim for anyone already writing auto.
  3. Keep auto, and make the docs and the schema description say plainly that it is a fixed built-in default, not an adaptive one. Cheapest of all, and closes the misleading-name problem without touching behaviour.

Option 3 is probably the right first move, with option 1 revisited only if measurement shows the defaults are actually costing users throughput.

Depends on the performance-baseline issue for anything beyond option 3: changing a default without a number is guessing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformanceSpeed, throughput or resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions