Database settings
Use these settings to configure Blnk’s PostgreSQL connection and connection pool.Note: Blnk only supports PostgreSQL as its database engine. You cannot use other database engines like MySQL or SQLite with Blnk.
In
blnk.json, conn_max_lifetime and conn_max_idle_time are integer seconds. Environment variables accept Go duration format (e.g. 30m, 5m).BLNK_DATA_SOURCE_DNS
This is the PostgreSQL connection string Blnk uses to connect to its database. This setting is required. Blnk will not start without it.
From 0.15.4, Blnk retries the initial database connection instead of exiting on the first failure.
- Make sure the database is reachable from the environment where Blnk is running. This includes verifying the hostname, port, credentials, and network access rules before starting the server.
-
You should also make sure the
sslmodein the connection string matches what your database provider expects. If this is set incorrectly, Blnk may fail to connect even when the rest of the connection string is valid.
Best practices
- Always set
BLNK_DATA_SOURCE_DNSexplicitly. - Start with the default pool settings unless you already know your database limits.
- Increase
BLNK_DATABASE_MAX_OPEN_CONNSonly if your PostgreSQL instance can handle more concurrent connections. - Use the connection lifetime and idle time settings to recycle stale connections in long-running deployments.
Redis configuration
In
blnk.json, conn_max_idle_time is a duration in nanoseconds (for example 120000000000 for 2m). Environment variables accept Go duration format (for example 2m).BLNK_REDIS_DNS
BLNK_REDIS_DNS is the Redis address or connection URL Blnk uses for queueing and coordination. This setting is required.
Why? Because Blnk uses Redis for distributed balance locks, transaction and webhook queues, hot-pair state, and other worker coordination. If Redis is unavailable, queue processing and lock coordination are affected even if PostgreSQL is healthy.
BLNK_REDIS_SKIP_TLS_VERIFY
This disables certificate verification for TLS Redis connections.
Only set to true when you are working in a controlled environment and understand the risk. Disabling certificate verification weakens transport security and should not be the default for production deployments.
BLNK_REDIS_CONN_MAX_IDLE_TIME
Available in version 0.15.5 and later.
How long a pooled Redis or Asynq connection may sit idle before Blnk discards it instead of reusing it. Applies to Redis cache clients and Asynq queue workers. The default is 2m. Leave it unset unless your Redis, Valkey, or proxy idle timeout is shorter than that.
Set this below the server or proxy idle timeout (managed services often use about 300 seconds). If a connection stays idle longer than the remote timeout, the next command can fail with write: broken pipe.
Typesense configuration
Use these settings to enable Blnk search and indexing via Typesense.In
blnk.json, backpressure_retry_interval is a duration in nanoseconds (for example 5000000000 for 5s). The environment variable accepts Go duration format (for example 5s). Omit the field to use the default.
Set Typesense memory limits on the Typesense service itself, not in Blnk:
typesense.env