KEYCLOAK-6140 Allow to customize max_connections parameter of MariaDB server

This commit is contained in:
Tomas Kyjovsky 2018-01-09 13:42:10 +01:00 committed by Hynek Mlnařík
parent 46ebff2163
commit 4ab856a0be
6 changed files with 24 additions and 5 deletions

View file

@ -1,6 +1,9 @@
FROM mariadb:10.3
ADD wsrep.cnf /etc/mysql/conf.d/
ARG MAX_CONNECTIONS=100
ADD wsrep.cnf.template /etc/mysql/conf.d/
RUN sed -e s/@MAX_CONNECTIONS@/$MAX_CONNECTIONS/ /etc/mysql/conf.d/wsrep.cnf.template > /etc/mysql/conf.d/wsrep.cnf; cat /etc/mysql/conf.d/wsrep.cnf
ADD mariadb-healthcheck.sh /usr/local/bin/
RUN chmod -v +x /usr/local/bin/mariadb-healthcheck.sh

View file

@ -13,6 +13,8 @@ innodb_doublewrite=1
innodb_buffer_pool_size=122M
max_connections=@MAX_CONNECTIONS@
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so

View file

@ -58,6 +58,7 @@
<db.dc1.docker.cpusets>1</db.dc1.docker.cpusets>
<db.dc2.docker.cpusets>1</db.dc2.docker.cpusets>
<db.docker.memlimit>2g</db.docker.memlimit>
<db.max.connections>100</db.max.connections>
<db.dump.download.site>https://downloads.jboss.org/keycloak-qe</db.dump.download.site>
<!-- Load Balancer Settings -->
@ -418,6 +419,7 @@
<DB_DC1_CPUSETS>${db.dc1.docker.cpusets}</DB_DC1_CPUSETS>
<DB_DC2_CPUSETS>${db.dc2.docker.cpusets}</DB_DC2_CPUSETS>
<DB_MEMLIMIT>${db.docker.memlimit}</DB_MEMLIMIT>
<DB_MAX_CONNECTIONS>${db.max.connections}</DB_MAX_CONNECTIONS>
<LB_CPUSETS>${lb.docker.cpusets}</LB_CPUSETS>
<LB_DC1_CPUSETS>${lb.dc1.docker.cpusets}</LB_DC1_CPUSETS>

View file

@ -13,7 +13,10 @@ networks:
services:
mariadb:
build: db/mariadb
build:
context: db/mariadb
args:
MAX_CONNECTIONS: ${DB_MAX_CONNECTIONS:-100}
image: keycloak_test_mariadb:${KEYCLOAK_VERSION:-latest}
cpuset: ${DB_CPUSET:-1}
mem_limit: ${DB_MEMLIMIT:-2g}

View file

@ -82,7 +82,10 @@ services:
mariadb_dc1:
build: db/mariadb
build:
context: db/mariadb
args:
MAX_CONNECTIONS: ${DB_MAX_CONNECTIONS:-100}
image: keycloak_test_mariadb:${KEYCLOAK_VERSION:-latest}
cpuset: ${DB_DC1_CPUSET:-1}
mem_limit: ${DB_MEMLIMIT:-2g}
@ -101,7 +104,10 @@ services:
- "3307:3306"
mariadb_dc2:
build: db/mariadb
build:
context: db/mariadb
args:
MAX_CONNECTIONS: ${DB_MAX_CONNECTIONS:-100}
image: keycloak_test_mariadb:${KEYCLOAK_VERSION:-latest}
depends_on:
mariadb_dc1:

View file

@ -9,7 +9,10 @@ networks:
services:
mariadb:
build: db/mariadb
build:
context: db/mariadb
args:
MAX_CONNECTIONS: ${DB_MAX_CONNECTIONS:-100}
image: keycloak_test_mariadb:${KEYCLOAK_VERSION:-latest}
cpuset: ${DB_CPUSET:-1}
mem_limit: ${DB_MEMLIMIT:-2g}