v2.2.0 — Parallel TCP Streams
Summary
- Parallel TCP streams for file transfers — auto-enabled for files > 5 MiB
- 1.74x speedup on 50MB files over high-RTT relay links (77ms RTT)
- 1.21x faster than scp for 50MB files
What changed
- Client opens N WebSocket connections (
sendFileParallel), each sending interleaved chunks - Daemon uses seek-based writes to place each chunk at the correct offset
- Relay uses atomic header+binary forwarding to prevent interleaving
- Auto-parallel: files > 5 MiB get 2 streams by default
- Override with
RCMD_PARALLEL_STREAMS=N(0 = disabled)
Benchmark (50MB random → rbm21, 77ms RTT relay)
| Method | Time | Throughput | vs scp |
|---|---|---|---|
| scp | 87.0s | 600 KB/s | 1.0x |
| rcmd 1 stream | 124.9s | 421 KB/s | 0.70x |
| rcmd 2 streams | 86.6s | 608 KB/s | 1.00x |
| rcmd 3 streams | 72.0s | 734 KB/s | 1.21x |
All transfers verified with sha256sum.
Test plan
- Unit tests pass
- 10MB transfer with 2 streams — integrity verified
- 50MB transfer with 3 streams — integrity verified
- Small file (1MB) uses single stream
- Auto-parallel for files > 5MB
Generated with Devin