forked from coop-cloud/nextcloud
Merge pull request 'Add mysql tuning stuff' (#23) from my-tune into main
Reviewed-on: coop-cloud/nextcloud#23
This commit is contained in:
commit
56712f48ff
1
abra.sh
1
abra.sh
|
@ -1,5 +1,6 @@
|
|||
export FPM_TUNE_VERSION="v2"
|
||||
export NGINX_CONF_VERSION="v2"
|
||||
export MY_CNF_VERSION="v1"
|
||||
|
||||
NC_APP_DIR="app:/var/www/html"
|
||||
|
||||
|
|
|
@ -78,12 +78,14 @@ services:
|
|||
|
||||
db:
|
||||
image: "mariadb:10.5"
|
||||
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
||||
environment:
|
||||
- MYSQL_DATABASE=nextcloud
|
||||
- MYSQL_USER=nextcloud
|
||||
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
|
||||
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
||||
configs:
|
||||
- source: my_tune
|
||||
target: /etc/mysql/conf.d/my-tune.cnf
|
||||
secrets:
|
||||
- db_root_password
|
||||
- db_password
|
||||
|
@ -147,6 +149,9 @@ configs:
|
|||
fpm_tune:
|
||||
name: ${STACK_NAME}_fpm_tune_${FPM_TUNE_VERSION}
|
||||
file: fpm-tune.ini
|
||||
my_tune:
|
||||
name: ${STACK_NAME}_my_cnf_${MY_CNF_VERSION}
|
||||
file: my-tune.cnf
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
|
|
17
fpm-tune.ini
17
fpm-tune.ini
|
@ -3,3 +3,20 @@ pm.max_children = 131
|
|||
pm.start_servers = 32
|
||||
pm.min_spare_servers = 32
|
||||
pm.max_spare_servers = 98
|
||||
|
||||
# https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/linux_database_configuration.html
|
||||
extension=pdo_mysql.so
|
||||
|
||||
[mysql]
|
||||
mysql.allow_local_infile=On
|
||||
mysql.allow_persistent=On
|
||||
mysql.cache_size=2000
|
||||
mysql.max_persistent=-1
|
||||
mysql.max_links=-1
|
||||
mysql.default_port=
|
||||
mysql.default_socket=/var/lib/mysql/mysql.sock
|
||||
mysql.default_host=
|
||||
mysql.default_user=
|
||||
mysql.default_password=
|
||||
mysql.connect_timeout=60
|
||||
mysql.trace_mode=Off
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
# https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/linux_database_configuration.html
|
||||
[server]
|
||||
skip_name_resolve = 1
|
||||
innodb_buffer_pool_size = 128M
|
||||
innodb_buffer_pool_instances = 1
|
||||
innodb_flush_log_at_trx_commit = 2
|
||||
innodb_log_buffer_size = 32M
|
||||
innodb_max_dirty_pages_pct = 90
|
||||
query_cache_type = 1
|
||||
query_cache_limit = 2M
|
||||
query_cache_min_res_unit = 2k
|
||||
query_cache_size = 64M
|
||||
tmp_table_size= 64M
|
||||
max_heap_table_size= 64M
|
||||
slow_query_log = 1
|
||||
slow_query_log_file = /var/log/mysql/slow.log
|
||||
long_query_time = 1
|
||||
|
||||
[client]
|
||||
default-character-set = utf8mb4
|
||||
|
||||
[mysqld]
|
||||
character_set_server = utf8mb4
|
||||
collation_server = utf8mb4_general_ci
|
||||
transaction_isolation = READ-COMMITTED
|
||||
binlog_format = ROW
|
||||
innodb_large_prefix=on
|
||||
innodb_file_format=barracuda
|
||||
innodb_file_per_table=1
|
Loading…
Reference in New Issue