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

Configuration

Environment variables:

VariableDefaultDescription
PORT3000Port the server listens on
WORKERSCPUs of the processNumber of worker threads for /stress and /cpu
MAX_NUMBER50Highest number accepted by /stress
MAX_DELAY_MS60000Highest ms accepted by /delay
MAX_MEMORY_MB512Total memory /memory can hold at once
MAX_DISK_MB1024Total disk space /disk can hold at once
UIoff1 turns on the control panel at /ui
START_DELAY_SECONDS0Seconds the port stays closed after the start
SHUTDOWN_GRACE_SECONDS0Seconds SIGTERM drains for before the process ends, see Shutdown
MAX_FD10000Total descriptors /fd can hold at once
MAX_CONNECTIONS500Total connections /connections can hold at once
MAX_BLOCK_MS30000Highest ms accepted by /block
ALLOW_OOMoff1 lets /oom run: it allocates until the kernel kills the process
MAX_PAYLOAD_MB1024Highest mb accepted by /payload, and the biggest upload it takes
MAX_LOG_LINES100000Highest lines accepted by /log
MAX_LOG_RATE10000Highest rate accepted by /log
TRUST_PROXYoffTrusts X-Forwarded-* (true, a number of hops, or addresses and subnets), see /echo
TOKENnoneMakes the endpoints that change the state need Authorization: Bearer <token>
MAX_HOLD_SECONDS300Highest hold, seconds and after accepted by the endpoints that take them
DISK_DIRsystem temp dirDirectory where /disk writes its files
LOG_FORMATtextjson writes one JSON object a line instead of plain text, see Logs

A number must be a positive integer. A value that is not one is reported at startup and replaced by the default.

docker run -p 3000:3000 -e WORKERS=2 -e MAX_MEMORY_MB=2048 altrdev/torchio:latest