Skip to content

Plain-URL live engines cap at two concurrent per origin: the static persistentSession's 2-connections-per-host pool starves the third pump #450

Description

@cmcpherson274

Running more than two plain-URL live engines against one origin, the third engine's pump never receives a byte. Measured on the tvOS simulator and an Apple TV 4K (3rd gen, tvOS 26.6), engine 6.55.0, anchors re-verified unchanged at 6.56.3.

The shape

Host context: we now run the engine on N small live surfaces (a picture-in-guide preview tile, and an experimental multiview grid of up to four tiles), each its own engine instance per the "one engine per playback surface" doc. A forced 4-tile grid against one Jellyfin origin settles the same way on sim and device:

  • Tiles 1–2 tune normally (started (route loopback, 4.5s/4.6s) on the sim run).
  • Tiles 3 and 4: startup 0/8 dispatchedpump conn start gen=1 offset=0 open-endedzero bytesstartup 1/8 sourceOpened only at +15.0 s (the reader's open deadline arc, both tiles, both platforms) → start timeout.

The origin is not the wall: three concurrent raw curl pulls of the same /Videos/<id>/stream.ts?Static=true endpoints (three channels, same client IP, no engine involved) all flowed at full rate for the 12 s probe window.

The anchor

AVIOReader.persistentSession is a private static let — one URLSession for the whole process — and makeSessionConfig sets httpMaximumConnectionsPerHost = 2 (Demuxer/AVIOReader.swift:54 and :3411 at 6.56.3). Two open-ended live stream.ts pulls occupy both connections to the origin for their whole lifetime, so a third pump's task queues in URLSession indefinitely. OriginRequestBudget is not involved: it is count-only with no host-declared limit and no 429/503/509 was ever answered.

Custom-source loads are unaffected (the host feeds those), which is why a full-screen tune on our host-owned spool coexists with one plain-URL tile — the ceiling only shows up at the second plain-URL live engine plus one.

The ask

Whichever fits the design: a per-instance session for the open-ended live pump, a LoadOptions knob for connections-per-host, or — if two per origin is the intended contract for N instances — a line of documentation saying so, so a host can plan surfaces around it. No urgency on our side: we measured it behind a disabled-by-default experiment and are shipping the multiview surface on AVFoundation regardless; the preview tile (one engine) is inside the ceiling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions