osp-mysql

List of configuration files

Filename

Short description

Format

Documentation

module.service

Each service is defined in a separate file and then combined into a unified compose stack file

yaml

See the Swarm administration or Official documentation

Environment Variables

All modules env variables

Variable Name

Default Value

Usage

PROMETHEUS_PORT

9100

The internal port used for Openmetrics exposition.

DISPATCHER_HOST

modules_configuration-dispatcher_main

The hostname on which the modules can fetch the configuration.

DISPATCHER_PORT

10000

The port used by the module to listen for configuration request.

USE_LEGACY_RESTART

Not set

When this flag is enabled, the container will terminate itself whenever a restart is needed (for example, after a configuration change). This is the legacy restart (before version 2.1.0). Otherwise, the system will simply restart the process running inside the container.

CUSTOM_JVM_OPTIONS

Not set

Allow to inject JVM options. See Configuration changes for more information.

ALLOW_VERSION_MISMATCH

Not set

Allow to disable the version check when a new configuration is published to a module. By default, a module will not be restarted if its configuration does not match its version.

Dedicated variables

The following variables control the MySQL tuning parameters at container startup. The defaults are intentionally conservative: the only database hosted is Keycloak’s, which is small and not heavily loaded. All values can be overridden in module.service under the environment key.

Variable name

Default value

Usage

OSP_MYSQL_PERFORMANCE_SCHEMA

OFF

Enable or disable the MySQL Performance Schema (ON / OFF). Disabling it reduces idle RAM usage by several dozen megabytes. Set to ON if you need query-level diagnostics.

OSP_MYSQL_INNODB_BUFFER_POOL_SIZE

32M

Size of the InnoDB buffer pool, the main in-memory cache for table and index data. Increase this value if MySQL reports many buffer pool misses or if the Keycloak database grows significantly.

OSP_MYSQL_INNODB_BUFFER_POOL_CHUNK_SIZE

32M

Chunk size used when the buffer pool is resized dynamically. Must be a divisor of OSP_MYSQL_INNODB_BUFFER_POOL_SIZE; keep both values equal unless dynamic resizing is required.

OSP_MYSQL_INNODB_LOG_BUFFER_SIZE

2M

Size of the buffer used to write InnoDB redo-log entries before they are flushed to disk. A larger value reduces I/O for workloads with many small transactions.

OSP_MYSQL_INNODB_REDO_LOG_CAPACITY

16M

Total capacity of the InnoDB redo log on disk. A larger value allows longer transactions and reduces checkpoint frequency at the cost of slower crash recovery.

OSP_MYSQL_KEY_BUFFER_SIZE

8K

Size of the buffer for MyISAM index blocks. Keycloak uses InnoDB exclusively, so the minimum value is appropriate.

OSP_MYSQL_MAX_CONNECTIONS

20

Maximum number of simultaneous client connections. Keycloak typically maintains a small connection pool; increase this value only if connection errors appear in the logs.

OSP_MYSQL_TABLE_OPEN_CACHE

64

Number of open table descriptors cached across all threads. Increase if the status variable Opened_tables grows rapidly.

OSP_MYSQL_TABLE_DEFINITION_CACHE

64

Number of table definitions (frm objects) held in memory. Should be at least as large as the number of tables in the Keycloak schema.

OSP_MYSQL_THREAD_CACHE_SIZE

4

Number of threads cached for reuse after a connection closes. Reduces thread-creation overhead under moderate connection churn.

OSP_MYSQL_TMP_TABLE_SIZE

8M

Maximum size of in-memory temporary tables created by the query engine. Temporary tables larger than this limit are converted to on-disk tables.

OSP_MYSQL_MAX_HEAP_TABLE_SIZE

8M

Maximum size of user-created MEMORY tables. Should be kept in sync with OSP_MYSQL_TMP_TABLE_SIZE.