This repository was archived by the owner on Oct 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
fix(mysql_server_mariadb): Set production values as default #2300
Open
klausi
wants to merge
1
commit into
codeenigma:2.x
Choose a base branch
from
klausi:mariadb-tuning
base: 2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,9 @@ | ||
| [mysqld] | ||
| bind-address = 0.0.0.0 | ||
| character_set_server = utf8 | ||
| collation_server = utf8_general_ci | ||
| bind-address = 127.0.0.1 | ||
| slow_query_log = 1 | ||
| slow_query_log_file = /var/log/mysql/slow-query.log | ||
| slow_query_log_file = /var/log/mysql/mariadb-slow.log | ||
| log_slow_admin_statements = 1 | ||
| general_log = 0 | ||
| log_queries_not_using_indexes = 1 | ||
| long_query_time = {{ mysql_server.long_query_time }} | ||
| skip-host-cache | ||
| skip-name-resolve | ||
|
|
@@ -16,23 +13,31 @@ read_buffer_size = 8M | |
| read_rnd_buffer_size= 4M | ||
| sort_buffer_size= 4M | ||
| bulk_insert_buffer_size = 16M | ||
| max_allowed_packet= 128M | ||
| # We need a large size for big tables during backups. | ||
| max_allowed_packet = 1G | ||
| thread_cache_size = 200 | ||
| max_connections = 300 | ||
| open_files_limit= 2000 | ||
| tmp_table_size= 128M | ||
| max_heap_table_size = 128M | ||
| query_cache_size= 1G | ||
| query_cache_limit = 128M | ||
| query_cache_type= 1 | ||
| tmp_table_size= 1G | ||
| max_heap_table_size = 1G | ||
| # Query cache is disabled for performance reasons for now. | ||
| query_cache_size= 0 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy for these to be |
||
| query_cache_type= 0 | ||
| join_buffer_size = 512M | ||
| sql_mode = NO_ENGINE_SUBSTITUTION | ||
| innodb_buffer_pool_size= 512M | ||
| # Use a quarter of the total RAM for the buffer pool. | ||
| innodb_buffer_pool_size = {{ ansible_facts.memtotal_mb // 4 }}M | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above, this should probably be a variable. You could have this in mysql_server:
innodb_buffer_pool_size: "{{ ansible_facts.memtotal_mb // 4 }}M"And then in this template: Gives people more flexibility. |
||
| innodb_read_io_threads = 8 | ||
| innodb_write_io_threads= 8 | ||
| innodb_flush_method= O_DIRECT | ||
| innodb_io_capacity = 400 | ||
| innodb_file_per_table= 1 | ||
| innodb_flush_log_at_trx_commit = 1 | ||
| innodb_flush_log_at_trx_commit = 2 | ||
| sync_binlog= 100 | ||
| innodb_stats_on_metadata = 0 | ||
|
|
||
| [mysqldump] | ||
| quick | ||
| quote-names | ||
| # We need a large size for big tables during backups. | ||
| max_allowed_packet = 1G | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need lines 33 to 41 for our
ce-devproduct that the database container. This might change in the future, but for now these lines should be left in.is_local: falseis the default, so they will not have any effect on production systems.