Skip to main content
Version: 0.1

Configuration

The pidief server is configured with environment variables.

Environment variables​

VariableDefaultDescription
PIDIEF_ADDR:3000listen address
PIDIEF_API_KEYS(empty)comma-separated keys for X-Api-Key; empty disables authentication (development only)
PIDIEF_MAX_REQUEST_MB50request body limit
PIDIEF_CONCURRENCYmin(4, CPUs)operations running at once
PIDIEF_QUEUE_SIZE100requests that may wait for a slot; more get 429
PIDIEF_QUEUE_TIMEOUT30show long a request waits for a slot before 503
PIDIEF_MAX_TIMEOUT120supper bound of the timeout parameter
PIDIEF_ALLOW_EXTERNALfalseallow the allowExternal parameter (HTML loading internet resources)
PIDIEF_JOB_TTL15mhow long finished job results are kept
PIDIEF_MAX_JOBS200jobs kept in memory
PIDIEF_METRICS_PUBLICtrueserve /metrics without a key
PIDIEF_CHROMIUM_PATHautoChromium path (/usr/bin/chromium-headless-shell in the image)
PIDIEF_CHROMIUM_NO_SANDBOXfalsetrue in the image (containers lack user namespaces)
PIDIEF_CHROMIUM_RESTART_AFTER200restart Chromium after this many conversions
PIDIEF_RASTER_WORKERS2PDFium WebAssembly instances
PIDIEF_SHUTDOWN_TIMEOUT30sgraceful shutdown wait
PIDIEF_LOG_LEVEL / PIDIEF_LOG_FORMATinfo / jsonstructured logs (slog)

Metrics​

/metrics exposes Prometheus metrics:

  • pidief_operations_total{op,status}
  • pidief_operation_duration_seconds
  • pidief_input_bytes
  • pidief_operations_running
  • pidief_operations_waiting
  • plus Go and process metrics

Resource usage​

Measured with the repository's scripts/measure.sh pidief:dev 8 40 on Docker Desktop (amd64), PIDIEF_CONCURRENCY=4, with a 300-row table rendered to 10 pages with page numbers:

MeasureValue
Image size (amd64 / arm64)256 MiB / 258 MiB
Idle memory (Chromium warm)~71 MiB
Peak memory, 8 concurrent requests~191-194 MiB
40 requests, 8 concurrent40/40 ok in 8.5 s
Latency (10 pages)p50 0.62-0.75 s, p95 1.2-1.8 s

Numbers depend on the CPU. In production, a 1 GB memory limit and --shm-size 256m are recommended.

Security defaults​

  • External network requests from HTML are blocked by default (allowExternal=false), and the server can forbid the parameter entirely with PIDIEF_ALLOW_EXTERNAL.
  • The container runs as a non-root user with a read-only root.
  • Request size and concurrency are limited.