Skip to content
Save my spot

Relay: diskless does not mean workless

Why the relay (server route) keeps no file yet still uses memory and CPU, and how backpressure keeps it bounded.

With the relay (server route), both endpoints must be reachable at the same time. The service authenticates and authorizes them, binds them to the same attempt and forwards bounded binary messages. File bytes never touch object storage or the message bus. Endpoint matching, budgets, ongoing permission checks and cancellation remain necessary.

Diskless means no file is ever written, not zero RAM. Socket buffers, frame buffers and bounded processing need memory. Backpressure, the pushback from a slow receiver, makes the chain slow the sender down instead of collecting the whole file in an unbounded queue.

DiagramA bounded relay path with backpressureDiagram: the sender sends through an HTTPS and WebSocket proxy to an authorized relay channel and on to the receiver. When the receiver can take less, a bounded backpressure travels back through the relay and the proxy, and the sender is slowed down.
  1. SenderEncrypted framesFile dataHTTPS/WebSocket proxy
  2. HTTPS/WebSocket proxyBounded forwardingFile dataAuthorized relay channel
  3. Authorized relay channelEncrypted framesFile dataReceiver
  4. ReceiverCan take less right nowAlternative pathAuthorized relay channel
  5. Authorized relay channelBounded backpressureAlternative pathHTTPS/WebSocket proxy
  6. HTTPS/WebSocket proxyThe sender is slowed downAlternative pathSender

Why can CPU load still occur?

CPU load on a relay is packet handling and TLS, not file decryption. The host handles network packets, TLS at the HTTPS endpoint, WebSocket frames, copies between buffers, system calls and process wake-ups. With small frames or additional proxy hops this management effort can matter even though no AES decryption of the file happens on the server.

The relay reuses buffers and batches small socket writes. Larger bounded write buffers are no new file storage and no reason to switch off permission checks, time limits or backpressure. More server cores help several simultaneous connections; they do not promise that a single serial data path gets faster.

A process failure can end the channel. The relay is a live channel, not a mailbox: if either side drops, the transfer resumes with a new attempt under the same order.