Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mysql_server_mariadb): Set production values as default #2300

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

klausi
Copy link
Contributor

@klausi klausi commented Feb 11, 2025

Problem: the MariaDB role is not tuned for production. Here are the values we tweaked.

Let me know if this is something you would like to merge, then I can also make a PR for the devel branch.

Copy link
Member

@gregharvey gregharvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, if we could have a few more of the server settings configurable as Ansible variables that would make the role more flexible. If you like I can add you to the project and you can push your feature branch, and then I can make these changes for you? 🙂

state: restarted
enabled: true

- name: Update MySQL root password.
Copy link
Member

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-dev product that the database container. This might change in the future, but for now these lines should be left in. is_local: false is the default, so they will not have any effect on production systems.

tmp_table_size= 1G
max_heap_table_size = 1G
# Query cache is disabled for performance reasons for now.
query_cache_size= 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy for these to be 0 by default, but they should be in defaults so people can change them if they would like to. The comment should move to defaults/main.yml against the variable too.

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
Copy link
Member

Choose a reason for hiding this comment

The 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 defaults/main.yml:

mysql_server:
  innodb_buffer_pool_size: "{{ ansible_facts.memtotal_mb // 4 }}M"

And then in this template:

innodb_buffer_pool_size = {{ mysql_server.innodb_buffer_pool_size }}

Gives people more flexibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants