Last active
November 20, 2022 09:30
-
-
Save pascalandy/3ffb1b443fd143382a7cd2d4dae9a144 to your computer and use it in GitHub Desktop.
This mysql config is made to run within the official mysql container.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### # | |
# | |
# _dockerfile/mysql/conf.d/my.cnf | |
# Last update: 2017-01-05_10h05 | |
# | |
# This mysql config is made to run within the official mysql container. | |
# https://hub.docker.com/_/mysql/ | |
# | |
# Inspired by: | |
# https://www.percona.com/blog/2016/10/12/mysql-5-7-performance-tuning-immediately-after-installation/ | |
# https://github.com/kamipo/etcfiles/blob/master/etc/my.cnf | |
# https://gist.github.com/pascalandy/9be333d68101dcfc84854279b5629a9d | |
# | |
# Code versionning: | |
# https://gist.github.com/pascalandy/3ffb1b443fd143382a7cd2d4dae9a144 | |
# | |
# nano /root/deploy-setup/_dockerfile/mysql/conf.d/my.cnf | |
# --mount type=bind,src=/root/deploy-setup/_dockerfile/mysql/conf.d,dst=/etc/mysql/conf.d \ | |
# | |
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### # | |
[mysqld] | |
# other variables here | |
innodb_buffer_pool_size = 512M # (adjust value here, 50%-70% of total RAM) | |
innodb_log_file_size = 256M | |
innodb_flush_log_at_trx_commit = 1 # may change to 2 or 0 | |
innodb_flush_method = O_DIRECT | |
innodb_autoinc_lock_mode=2 | |
innodb_io_capacity_max=4000 | |
innodb_io_capacity=2000 |
As I am not a DBA or a mysql expert, please let me know if we can improve something on this config.
The container will run within a public cloud like DigitalOcean or Vultr with SSD drives.
Cheers!
twitter.com/_pascalandy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is another config that may help - https://gist.github.com/pascalandy/e829c7db01a329d83bbe64b72cd642f2