Repository navigation
feat(roles/mariadb_server): make table_open_cache_instances configurable - #783
Merged
Merged
Conversation
MariaDB lowers table_open_cache_instances at startup to (open files - max_connections) / 2 / table_open_cache without logging it (sql/mysqld.cc), so with LimitNOFILE=32768 and table_open_cache=2000 a database host with 12 vCPUs stays at 8 instances and warns about table cache contention after every restart. LimitNOFILE now defaults to 65536 and the drop-in renders the highest of mariadb_server__service_limit_nofile, 65536 and the limit mariadb.service gets without it (LimitNOFILE of the packaged unit, else systemd's DefaultLimitNOFILE). The line is omitted where that OS limit is already the highest. Molecule verifies 16 instances on the full OS matrix.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
MariaDB lowers
table_open_cache_instancesat startup to(open files - max_connections) / 2 / table_open_cachewithout logging it (sql/mysqld.cc). WithLimitNOFILE=32768andtable_open_cache=2000, a database host with 12 vCPUs stays at 8 instances and warns about table cache contention after every restart.mariadb_server__cnf_table_open_cache_instances__host_var/__group_var(role default 8, the upstream default on 10.6 to 11.8).mariadb_server__service_limit_nofiledefaults to 65536. The drop-in renders the highest of the variable, 65536 and the limitmariadb.servicegets without it (LimitNOFILEof the packaged unit, else systemd'sDefaultLimitNOFILE), and omits the line where that OS limit is already the highest.Tested:
molecule test --scenario-name mariadb_serveron the full OS matrix (Debian 12/13, Rocky 8/9/10, Ubuntu 22.04/24.04/26.04), verify asserts 16 instances on the running server.