Skip to content

Example server configuration

Environment variables accepted by the included Axum server.

These variables configure cargo run --example serve. They are example-server contracts, not global library configuration.

VariableDefaultMeaning
ASYNC_GEOTIFF_BIND127.0.0.1:8080Socket address for the HTTP server.
ASYNC_GEOTIFF_BLOCK_CACHE_MB512Shared decoded-block cache capacity in MiB; must be positive.
ASYNC_GEOTIFF_MAX_DECODE_TASKSavailable parallelismMaximum concurrent decode/stitch CPU jobs; must be positive.
ASYNC_GEOTIFF_MAX_TILE_TASKSavailable parallelismMaximum concurrent tile warp/render CPU jobs; must be positive.
ASYNC_GEOTIFF_PREFETCH_RING1Number of native-block rings prefetched around a read; 0 disables it.
ASYNC_GEOTIFF_SLOW_TILE_MSunsetEmit a slow-tile warning above this positive millisecond threshold.
ASYNC_GEOTIFF_MOSAICunsetPath to a MosaicJSON file loaded at startup.
ASYNC_GEOTIFF_STAC_URLunsetFixed STAC API URL; requires the stac feature and the next two variables.
ASYNC_GEOTIFF_STAC_COLLECTIONunsetFixed STAC collection ID.
ASYNC_GEOTIFF_STAC_ASSET_KEYunsetFixed STAC COG asset key.
ASYNC_GEOTIFF_TOKIO_CONSOLEoffEnable Tokio Console with 1, true, yes, or on when compiled with tokio-console.
RUST_LOGasync_geotiff=debug,warnStandard tracing filter for the example server.

ASYNC_GEOTIFF_MOSAIC and the STAC configuration are mutually exclusive. All three STAC variables must be supplied together.

The decode-task and tile-task values tune single-COG work, but are not a single process-wide CPU cap. The command-line default COG uses separate limiters; lazily selected local datasets share one limiter sized to the larger value; mosaics own their own limiter. The example server does not expose environment variables for MosaicConfig fields such as max_assets_per_tile.

Example

ASYNC_GEOTIFF_BIND=0.0.0.0:8080 \
ASYNC_GEOTIFF_BLOCK_CACHE_MB=1024 \
ASYNC_GEOTIFF_MAX_DECODE_TASKS=8 \
ASYNC_GEOTIFF_MAX_TILE_TASKS=8 \
ASYNC_GEOTIFF_PREFETCH_RING=0 \
ASYNC_GEOTIFF_SLOW_TILE_MS=500 \
RUST_LOG=async_geotiff=info \
  cargo run --release --example serve -- https://example.com/cog.tif

Invalid numeric values fail at process startup instead of being silently clamped.