Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Limits and Performance

This appendix documents hard limits, configurable bounds, and observed performance characteristics of the peeroxide-cli tools.

Hard Limits

ConstantValueContext
MAX_ECHO_SESSIONS64Concurrent echo sessions per announce process
HANDSHAKE_TIMEOUT5 sEcho protocol handshake timeout
IDLE_TIMEOUT30 sEcho session idle timeout
ECHO_MSG_LEN16 bytesEcho probe frame size (fixed)
ECHO_TIMEOUT (ping)5 sPer-probe timeout in ping --connect mode
MAX_CHUNKS65 535Maximum chunks in a single dd message
MAX_PAYLOAD1 000 bytesMaximum payload per dd chunk
ROOT_HEADER_SIZE39 bytesdd root chunk header size
NON_ROOT_HEADER_SIZE33 bytesdd non-root chunk header size
CHUNK_SIZE (cp)65 536 bytescp file chunk size
--data max (announce)1 000 bytesMaximum --data payload for announce
lookup --with-data concurrency16buffer_unordered(16) for mutable DHT gets
ping topic mode peer cap20Maximum peers probed per topic lookup

Derived Limits

Maximum dd message size:

MAX_CHUNKS × MAX_PAYLOAD = 65 535 × 1 000 = ~65.5 MB

Practical limit is lower due to DHT value size constraints and network latency.

Maximum cp file size:

Limited by available DHT storage and client memory. Each 65 536-byte chunk is stored as a separate immutable DHT value. There is no hard-coded upper bound in the CLI, but very large files will require many round-trips.

Timing

ParameterValueNotes
announce refresh interval600 sBackground mutable put to keep slot alive
announce seqUnix epoch secondsTwo refreshes in the same second produce identical seq — see ISSUES.md
ping --interval default1.0 sConfigurable
ping --count default10 = infinite

Concurrency

  • lookup --with-data fetches peer data in parallel with a concurrency window of 16 (buffer_unordered(16)).
  • announce handles incoming connections concurrently; echo sessions are bounded by MAX_ECHO_SESSIONS = 64.
  • cp uploads/downloads chunks sequentially per file (parallelism may be added in future releases).

Exit Codes

CodeMeaningTools
0Success / clean shutdownall tools
1Fatal errorall tools
130SIGINT receivedlookup, ping
0SIGINT/SIGTERM receivedannounce (intentional — clean shutdown is success)

Note: announce returns 0 on SIGINT/SIGTERM because interactive shutdown is the normal workflow. lookup and ping return 130 to allow callers to distinguish interruption from success.

Chat

ParameterValueDescription
Max record size1000 bytesMaximum size for a single DHT record
Message overhead180 bytesFixed overhead (screen name + content combined ≤ 820 bytes)
EncryptionXSalsa20-Poly1305Security parameters: nonce 24 bytes, tag 16 bytes
Epoch length60 sTime window for message bucketing
Buckets per epoch4Sub-divisions within an epoch for message distribution
DHT lookups per cycle8Checks current and previous epoch across 4 buckets
Discovery interval8 sCadence for looking up new peers
Feed expiry1200 sTime before a peer feed is considered stale
Summary eviction trigger20 messagesNumber of messages before clearing old history
Summary eviction count15 messagesNumber of messages removed during eviction
Mutable put retries3Retries at 200 ms, 500 ms, and 1000 ms intervals
Rotation check interval30 sFrequency of checking for epoch/bucket rotation
Dedup ring capacity1000 hashesNumber of message hashes stored to prevent duplicates
Gap timeout5 sMaximum wait time for out-of-order messages
TUI history cap500 linesScrollback buffer limit in the interactive interface

Chat Performance

The inbox polling mechanism uses parallel lookups and mutable gets. A full inbox cycle typically completes in 2-4 seconds of wall-clock time. This is a significant improvement over earlier nested-serial designs which required 10-20 seconds for the same operation.

Dead Drop (v2)

ParameterValueDescription
Max chunk size1000 bytesTotal size including headers
Data payload998 bytesActual data bytes per non-root chunk
Root index slots30Pointers to child chunks in the root node
Non-root index slots31Pointers to child chunks in intermediate nodes
Need-list entries1248-byte entries published in each DHT record
Parallel fetch cap64Maximum concurrent DHT requests
Soft depth cap4Maximum tree depth (~27 GB capacity)
Per-put timeout30 sMaximum duration for a single chunk upload
Stall watchdog check5 sFrequency of progress monitoring
Stall watchdog trigger30 sTime with no progress before triggering a restart
Need-list publish20 sFrequency of publishing the local need-list
Need-list announce60 sKeepalive interval for the need-list topic
Refresh interval600 sDefault cadence for re-announcing data availability
Initial concurrency128Starting sender concurrency for AIMD
Fetch backoff500 ms to 15 sProgressive delay for failed mutable or immutable gets

Tree Capacity by Depth

The implementation enforces SOFT_DEPTH_CAP = 4. Depths beyond that are theoretical only and are rejected at PUT time.

DepthMax Data ChunksApprox. Capacity
03029 KB
1930928 KB
228,83028 MB
3893,730891 MB
427,705,63027 GB

AIMD Algorithms

v2 (Current):

  • Uses Exponentially Weighted Moving Average (EWMA) with alpha 0.1.
  • Decision interval of 20 samples.
  • Fast-trip threshold of 10.
  • Shrink factor: 0.75×.
  • Growth factor: +2.

v1 (Legacy):

  • Uses a tumbling window of 10 samples.
  • Halves concurrency if degradation exceeds 30%.
  • Increases concurrency by 1 if 0% degradation is detected.