Chapter 11. Environment variable configuration
Red Hat Quay supports a limited set of environment variables that control runtime behavior and performance tuning. These values provide flexibility in specific scenarios where per-process behavior, connection counts, or regional configuration must be adjusted dynamically.
Use environment variables cautiously. These options typically override or augment existing configuration mechanisms.
This section documents environment variables related to the following components:
- Geo-replication preferences
- Database connection pooling
- HTTP connection concurrency
- Worker process scaling
11.1. Geo-replication Copy linkLink copied to clipboard!
Red Hat Quay supports multi-region deployments where multiple instances operate across geographically distributed sites. In these scenarios, each site shares the same configuration and metadata, but storage backends might vary between regions.
To accommodate this, Red Hat Quay allows specifying a preferred storage engine for each deployment using an environment variable. This ensures that while metadata remains synchronized across all regions, each region can use its own optimized storage backend without requiring separate configuration files.
Use the QUAY_DISTRIBUTED_STORAGE_PREFERENCE
environment variable to explicitly set the preferred storage engine by its ID, as defined in DISTRIBUTED_STORAGE_CONFIG
.
Variable | Type | Description |
---|---|---|
QUAY_DISTRIBUTED_STORAGE_PREFERENCE | String | The preferred storage engine (by ID in DISTRIBUTED_STORAGE_CONFIG) to use. |
11.2. Database connection pooling Copy linkLink copied to clipboard!
Red Hat Quay is composed of many different processes which all run within the same container. Many of these processes interact with the database.
Database connection pooling is enabled by default, and each process that interacts with the database contains a connection pool. These per-process connection pools are configured to maintain a maximum of 20 connections. Under heavy load, it is possible to fill the connection pool for every process within a Red Hat Quay container. Under certain deployments and loads, this might require analysis to ensure that Red Hat Quay does not exceed the configured database’s maximum connection count.
Overtime, the connection pools release idle connections. To release all connections immediately, Red Hat Quay requires a restart.
Variable | Type | Description |
---|---|---|
DB_CONNECTION_POOLING | String |
Whether to enable or disable database connection pooling. Defaults to true. Accepted values are |
If database connection pooling is enabled, it is possible to change the maximum size of the connection pool. This can be done through the following config.yaml
option:
Database connection pooling example YAML
# ... DB_CONNECTION_ARGS: max_connections: 10 # ...
# ...
DB_CONNECTION_ARGS:
max_connections: 10
# ...
11.2.1. Disabling database pooling in standalone deployments Copy linkLink copied to clipboard!
For standalone Red Hat Quay deployments, database connection pooling can be toggled off when starting your deployment. For example:
11.2.2. Disabling database pooling for Red Hat Quay on OpenShift Container Platform Copy linkLink copied to clipboard!
For Red Hat Quay on OpenShift Container Platform, database connection pooling can be configured by modifying the QuayRegistry
custom resource definition (CRD). For example:
Example QuayRegistry CRD
11.3. HTTP connection counts Copy linkLink copied to clipboard!
You can control the number of simultaneous HTTP connections handled by Red Hat Quay using environment variables. These limits apply either globally or can be scoped to individual components (registry, web UI, or security scanning). By default, each worker process allows up to 50
parallel connections.
This setting is distinct from the number of worker processes.
These connection-related environment variables can be configured differently depending on your deployment type:
-
In standalone deployments, configure connection counts in the
config.yaml
file. -
In Red Hat Quay on OpenShift Container Platform deployments, define the values in the
env
block of theQuayRegistry
CR.
Variable | Type | Description |
---|---|---|
WORKER_CONNECTION_COUNT | Number |
Global default for the maximum number of HTTP connections per worker process. |
WORKER_CONNECTION_COUNT_REGISTRY | Number |
HTTP connections per registry worker. |
WORKER_CONNECTION_COUNT_WEB | Number |
HTTP connections per web UI worker. |
WORKER_CONNECTION_COUNT_SECSCAN | Number |
HTTP connections per Clair security scanner worker. |
HTTP connection configuration for standalone Red Hat Quay deployments
WORKER_CONNECTION_COUNT: 10 WORKER_CONNECTION_COUNT_REGISTRY: 10 WORKER_CONNECTION_COUNT_WEB: 10 WORKER_CONNECTION_COUNT_SECSCAN: 10
WORKER_CONNECTION_COUNT: 10
WORKER_CONNECTION_COUNT_REGISTRY: 10
WORKER_CONNECTION_COUNT_WEB: 10
WORKER_CONNECTION_COUNT_SECSCAN: 10
HTTP connection configuration for Red Hat Quay on OpenShift Container Platform
11.4. Worker process counts Copy linkLink copied to clipboard!
You can control the number of worker processes that handle incoming requests in Red Hat Quay using environment variables. These values define how many parallel processes are started to handle tasks for different components of the system, such as the registry, the web UI, and security scanning.
If not explicitly set, Red Hat Quay calculates the number of worker processes automatically based on the number of available CPU cores. While this dynamic scaling can optimize performance on larger machines, it might also lead to unnecessary resource usage in smaller environments.
In Red Hat Quay on OpenShift Container Platform deployments, the Operator sets the following default values:
-
WORKER_COUNT_REGISTRY
: 8 -
WORKER_COUNT_WEB
: 4 -
WORKER_COUNT_SECSCAN
: 2
Variable | Type | Description |
---|---|---|
WORKER_COUNT | Number | Generic override for number of processes |
WORKER_COUNT_REGISTRY | Number |
Specifies the number of processes to handle Registry requests within the |
WORKER_COUNT_WEB | Number |
Specifies the number of processes to handle UI/Web requests within the container |
WORKER_COUNT_SECSCAN | Number |
Specifies the number of processes to handle Security Scanning (e.g. Clair) integration within the container |
Worker count configuration for standalone Red Hat Quay deployments
WORKER_COUNT: 10 WORKER_COUNT_REGISTRY: 16 WORKER_COUNT_WEB: 8 WORKER_COUNT_SECSCAN: 4
WORKER_COUNT: 10
WORKER_COUNT_REGISTRY: 16
WORKER_COUNT_WEB: 8
WORKER_COUNT_SECSCAN: 4
Worker count configuration for Red Hat Quay on OpenShift Container Platform