Settings

JOpt.TourOptimizer reads its settings from environment variables when it starts. Set them on the container: with -e on docker run, in the environment block of a compose file, or in the env list of a Kubernetes pod. The defaults below are those of trusted mode. A setting that only auth mode reads is marked and links to the JOpt Platform, which sets it for you.

The Spring profile decides the mode when TourOptimizer starts. Without the profile auth it runs in trusted mode, with optional settings such as DNA_DATABASE_ACTIVE, DNA_DEFAULT_LIC, DNA_TO_MASTER_KEY and DNA_WEBHOOK_VALIDATION. With SPRING_PROFILES_ACTIVE=auth it runs in auth mode and needs the services of the JOpt Platform stack: Keycloak, Infisical, Redis, MongoDB and GeoCoderRouter. An old switch or a mix of both modes stops the start.

The diagram opens full size on click.

Value formats:

  • A duration is an ISO 8601 duration such as PT30M or P7D, or a number with a unit such as 60s or 2m. Where the table says so, UNLIMITED is allowed too.
  • A size is a number with a unit such as 10GB or 256MB, or UNLIMITED where the table says so.
  • TourOptimizer checks its settings at the start. A value it cannot read, or a combination it does not allow, stops the start.

Choose the mode

VariableDefaultWhat it does
SPRING_PROFILES_ACTIVEemptyWithout the profile auth, TourOptimizer runs in trusted mode. With auth, it runs in auth mode and needs the services of the JOpt Platform stack. The profile cors allows calls from a browser on another origin.
DNA_DEPLOYMENT_MODEon-premon-prem or hosted. hosted refuses to start without the profile auth, with the profile cors, with the API documentation or the Swagger UI switched on, or with the example database login.

Which mode fits which setup is on Choose a mode.

Server and API

VariableDefaultWhat it does
DNA_SERVER_PORT8081The port of the REST API
DNA_SERVER_URL/The server URL that the OpenAPI schema names
DNA_SERVER_HTTP2_ENABLEDtrueHTTP/2, where the environment supports it
DNA_SERVER_COMPRESSION_ENABLEDtrueCompresses responses of the types in DNA_SERVER_COMPRESSION_MIME_TYPES (HTML, XML, text, CSS, JavaScript and JSON)
DNA_SERVER_COMPRESSION_MIN_RESPONSE_SIZE1024Compresses a response only from this size in bytes
DNA_FORWARD_HEADERS_STRATEGYnoneForwarded and X-Forwarded-* headers are ignored, so a caller cannot change the address, host, scheme or path that TourOptimizer sees. Set native or framework only behind a proxy that overwrites these headers on every request.
DNA_SHOW_SYNCH_CONTROLLERStrueThe synchronous runs and live streams (trusted mode)
DNA_SHOW_DEPRECATED_CONTROLLERSfalseThe endpoints of older releases
DNA_DATABASE_FREE_SEARCH_ENABLEDtrueThe search endpoints of the jobs
DNA_DATABASE_JOB_IMPORT_ENABLEDtrueThe job import (trusted mode)

A request body may hold up to 250 MB. TourOptimizer has no list of allowed caller addresses: restrict callers by address at the network layer, with a firewall or a proxy.

API documentation

VariableDefaultWhat it does
DNA_API_DOCS_ENABLEDtrueServes the OpenAPI schema
DNA_API_DOCS_PATH/v3/api-docsThe path of the OpenAPI schema
DNA_SWAGGER_UI_ENABLEDtrueServes the Swagger UI

Switch both off on a server that callers outside your network can reach. The schema of each release is also on the API page.

License

In trusted mode each job carries its JOpt license in extension.keySetting.jsonLicense. A job without one uses the default license of the server:

VariableDefaultWhat it does
DNA_DEFAULT_LICemptyThe license that a job without its own license runs with. Each use writes a warning to the log.

A job with neither license is refused with 403 LICENSE_MISSING. In auth mode TourOptimizer ignores both: it removes the license of the request and runs the job with the license of the tenant from the JOpt Platform stack.

Database and jobs

Jobs, the job queue, stored results and webhooks need MongoDB.

VariableDefaultWhat it does
DNA_DATABASE_ACTIVEfalseConnects to MongoDB and turns on jobs. Auth mode needs it, since it runs optimizations only as jobs.
DNA_DATABASE_URIexample valueThe connection string of MongoDB, for example mongodb://<user>:<password>@<host>:27017. Always set your own.
DNA_DATABASE_DBtouroptimizerThe name of the database. A missing database is created.
DNA_DATABASE_DOWNLOAD_ACTIVEfalseThe database read and write endpoints of older releases
DNA_DATABASE_CLEAN_SECONDS7200How often, in seconds, the cleaner deletes data whose keep time has ended
DNA_INSTANCE_ID_PREFIXemptyThe start of the name of this copy in the job records; empty uses the host name
DNA_INSTANCE_HEARTBEAT_INTERVAL15sHow often each copy writes its heartbeat
DNA_INSTANCE_LEASE2mA running job of a copy whose heartbeat is older than this ends INTERRUPTED. At least three heartbeat intervals.

Job queue and copies

How the queue works is on Jobs. The upload checks are on Checks and limits.

VariableDefault in trusted modeWhat it does
DNA_RUN_CAPACITYUNLIMITEDHow many queued jobs this copy runs at a time, over all tenants
DNA_QUEUE_CLAIM_INTERVAL1sHow often a copy with a free place looks for the next job
DNA_QUEUE_MAX_WAITUNLIMITEDHow long a job may wait. A job that waited longer ends CANCELLED with the stop reason QUEUE_WAIT_EXCEEDED.
DNA_COPY_ROLEbothaccept serves the API and runs no job, run runs jobs and serves no API request, both does both
DNA_DRAIN_PORTemptyA port on 127.0.0.1 inside the copy, for a scaler that drains the copy before it removes it. Never publish it.
DNA_MAX_SUBMITS_IN_FLIGHTUNLIMITEDJob uploads that one copy receives at a time
DNA_MAX_SUBMIT_BYTES_IN_FLIGHTUNLIMITEDBytes of the job uploads that one copy receives at a time
DNA_MAX_SUBMITS_IN_FLIGHT_PER_TENANTno effectJob uploads of one tenant at a time (auth mode only)
DNA_MAX_TOTAL_QUEUED_BYTESUNLIMITEDThe input of all waiting jobs together, over all copies
DNA_SUBMIT_BODY_IDLE_TIMEOUTPT60SThe longest pause between two parts of an upload
DNA_STORAGE_RESERVE10GBThe free space that the MongoDB disk keeps; 0 turns the check off
DNA_ORPHAN_INPUT_AGEPT1HWhen the input of an upload that never became a job is removed; at least PT2M

In auth mode the stack sets its own values for these limits.

Run time and keep time

A job sets its max run time in extension.timeOut and its keep time in mongoSettings.expiry (Jobs). These settings apply when a job sets no value, and set the upper limit:

VariableDefault in trusted modeWhat it does
DNA_RUN_TIME_MAXUNLIMITEDThe max run time of a job, counted from the start of the run. At the limit the run stops and keeps its best result. A longer timeOut is refused.
DNA_KEEP_RESULTS_DEFAULTPT48HThe keep time of a job that sets none, counted from the end of the run
DNA_KEEP_RESULTS_MAXUNLIMITEDThe longest keep time a job may ask for. A longer expiry is refused.
DNA_SYNC_RUN_TIME_MAXPT1HThe max run time of a synchronous run; never UNLIMITED
DNA_RUN_STOP_GRACE60sA run that has not stopped this long after its limit ends ERROR

In auth mode the plan of the account sets these limits.

Encryption

How stored results are encrypted is on Jobs.

VariableDefaultWhat it does
DNA_TO_MASTER_KEYemptyTrusted mode: the master key of the server, 32 random bytes as base64 (for example from openssl rand -base64 32). With it, results are encrypted with a key per tenant. Empty: results are stored without encryption, and the start writes one warning. After a key change, a comma-separated list of v<n>:<base64> entries: the highest version encrypts, the others still decrypt.
DNA_KMS_PROVIDERnonelocal is a provider for development, in trusted mode only and never with a master key: its keys are kept in memory and lost on a restart.

Auth mode does not read DNA_TO_MASTER_KEY: its master key comes from the secrets store of the JOpt Platform stack.

Webhooks

VariableDefaultWhat it does
DNA_WEBHOOK_VALIDATIONnoneWhich webhook URLs are allowed: strict, relaxed or none (Jobs)
DNA_WEBHOOK_MAX_ATTEMPTS5How often a delivery is tried before it is given up

Geo data

Geo data comes from GeoCoderRouter, which runs in the JOpt Platform stack (GeoCoderRouter).

VariableDefaultWhat it does
DNA_GEOCODERROUTER_BASE_URLa local addressThe address of GeoCoderRouter
DNA_GCR_RESPONSE_TIMEOUT120sHow long TourOptimizer waits for an answer of GeoCoderRouter; then 504
DNA_GEOCODERROUTER_GEO_PROVIDER_ENABLEDtrueThe endpoint POST /api/v1/jobs/withGeoProvider
DNA_GEOCODERROUTER_GEOCODING_ENABLEDtrueThe geocoding endpoint
DNA_GEOCODING_PROVIDER, DNA_ROUTING_PROVIDER, DNA_MATRIX_PROVIDERemptyThe provider for a request that names none; empty uses the default of GeoCoderRouter

Element limits

VariableDefaultWhat it does
DNA_HAS_ELEMENT_LIMITSfalseLimits the elements of an optimization
DNA_ELEMENT_LIMITS_COUNT100The number of elements, when the limit is on

The refusal is on Checks and limits.

Health and metrics

VariableDefaultWhat it does
DNA_MANAGEMENT_PORTemptyEmpty: the health endpoints answer on the API port, and no metrics are served. A port: the health endpoints move to that port, and the Prometheus metrics are served there at /actuator/prometheus, without a password.
DNA_MANAGEMENT_ADDRESSemptyThe address of the management port. Empty: the address of this machine inside DNA_MANAGEMENT_SUBNET, else 127.0.0.1.
DNA_MANAGEMENT_SUBNETemptyThe network in which the management port takes its address, when each copy needs its own
DNA_MANAGEMENT_ADDRESS_FILEemptyA file that the chosen address is written to, for a health check inside the container

Never publish the management port: keep it on 127.0.0.1 or an internal network. It answers GET and HEAD only.

EndpointAnswers
/actuator/healthThe health of the process. The health check of the image reads it.
/actuator/health/livenessThe process answers.
/actuator/health/readiness503 unless every member is UP. In auth mode the members include the services of the JOpt Platform stack.
GET /api/v1/healthThe health on the API port

Logging

VariableDefaultWhat it does
DNA_LOG_FORMATemptyEmpty: plain lines. ecs (also logstash or gelf): one JSON object per line.
DNA_LOG_OPTIMIZER_EVENTSfalsetrue writes every progress, status, warning and error event of every run to the log; for troubleshooting only

Access protection in trusted mode

VariableDefaultWhat it does
DNA_SECURITY_ENABLEDfalsetrue: every request needs a user name and password, with HTTP basic or form login
DNA_USERdnaThe user name
DNA_PASSWORDnoneThe password. With DNA_SECURITY_ENABLED=true and no password, TourOptimizer does not start.

In auth mode every request needs the token of the signed-in user or client, and these settings have no effect.

Settings of auth mode

In auth mode TourOptimizer reads further settings: the sign-in (issuer and audience of the tokens), the secrets store, the quota store, the client gates and the upper limits of a request. The JOpt Platform stack sets all of them. They are described with the stack:


Added: 2026-11-27 | Last updated: 2026-11-27