Skip to content

Instantly share code, notes, and snippets.

@pascalandy
Last active November 20, 2022 09:30
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pascalandy/3ffb1b443fd143382a7cd2d4dae9a144 to your computer and use it in GitHub Desktop.
Save pascalandy/3ffb1b443fd143382a7cd2d4dae9a144 to your computer and use it in GitHub Desktop.
This mysql config is made to run within the official mysql container.
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
#
# _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
@pascalandy
Copy link
Author

pascalandy commented Dec 10, 2016

@pascalandy
Copy link
Author

pascalandy commented Dec 13, 2016

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