Skip to content

Commit

Permalink
Added InnoDB Tuning option. Closes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
pjan committed May 27, 2014
1 parent f3aa3c8 commit 04e19dd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,20 @@ mysql_table_cache: 64
mysql_thread_concurrency: 10
mysql_query_cache_limit: '1M'
mysql_query_cache_size: '16M'
mysql_innodb_file_per_table: 'innodb_file_per_table'
mysql_character_set_server: 'utf8'
mysql_collation_server: 'utf8_general_ci'
mysql_mysqldump_max_allowed_packet: '128M'
mysql_isamchk_key_buffer: '16M'

# InnoDB tuning
mysql_innodb_file_per_table: 'innodb_file_per_table'
mysql_innodb_flush_method: 'fdatasync'
mysql_innodb_buffer_pool_size: '128M'
mysql_innodb_flush_log_at_trx_commit: 1
mysql_innodb_lock_wait_timeout: 50
mysql_innodb_log_buffer_size: '1M'
mysql_innodb_log_file_size: '5M'

# List of databases to be created (optional)
mysql_databases:
- name: foobar
Expand Down
9 changes: 9 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ mysql_collation_server: 'utf8_general_ci'
mysql_mysqldump_max_allowed_packet: '128M'
mysql_isamchk_key_buffer: '16M'

# InnoDB tuning
mysql_innodb_file_per_table: 'innodb_file_per_table'
mysql_innodb_flush_method: 'fdatasync'
mysql_innodb_buffer_pool_size: '128M'
mysql_innodb_flush_log_at_trx_commit: 1
mysql_innodb_lock_wait_timeout: 50
mysql_innodb_log_buffer_size: '1M'
mysql_innodb_log_file_size: '5M'

# List of databases to be created
mysql_databases: []

Expand Down
12 changes: 10 additions & 2 deletions templates/etc_mysql_my.cnf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ datadir = /var/lib/mysql
tmpdir = /tmp
# language is for pre-5.5. In 5.5 it is an alias for lc_messages_dir.
language = {{ mysql_language }}
bind-address= {{ mysql_bind_address }}
bind-address = {{ mysql_bind_address }}
skip-external-locking


Expand Down Expand Up @@ -60,6 +60,15 @@ max_binlog_size = 100M
# ** InnoDB
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
innodb_flush_log_at_trx_commit = {{ mysql_innodb_flush_log_at_trx_commit }}
innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }}
{% if mysql_innodb_flush_method != 'fdatasync': %}
innodb_flush_method = {{ mysql_innodb_flush_method }}
{% endif %}
innodb_lock_wait_timeout = {{ mysql_innodb_lock_wait_timeout }}
innodb_log_buffer_size = {{ mysql_innodb_log_buffer_size }}
innodb_log_file_size = {{ mysql_innodb_log_file_size }}
{{ mysql_innodb_file_per_table }}

# ** Security Features
# Read the manual, too, if you want chroot!
Expand All @@ -70,7 +79,6 @@ max_binlog_size = 100M
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

{{ mysql_innodb_file_per_table }}
character_set_server = {{ mysql_character_set_server }}
collation_server = {{ mysql_collation_server }}

Expand Down

0 comments on commit 04e19dd

Please sign in to comment.