sous-chefs / mysql

Development repository for the mysql cookbook
https://supermarket.chef.io/cookbooks/mysql
Apache License 2.0
338 stars 690 forks source link

systemd resets mysql "max_connections" on CentOS 7 #533

Closed nkadel-skyhook closed 4 years ago

nkadel-skyhook commented 7 years ago

Cookbook version

8.5.1

Chef-client version

12.10.24

Platform Details

CentOS 7.4, MySQL 5.7.19

Scenario:

Set max_connections=10000 in MySQL configuration files. Systemd restart resets max_connect_errors to 241.

Steps to Reproduce:

Use systemd init tools for MySQL. Set "max_connections = 10000" in /etc/mysql-default/conf.d/max_connections.cnf. Restart mysql. Run "mysql -A -s -s -e 'show variables;' | grep max_connections"

Expected Result:

max_connections = 10000

Actual Result:

max_connections = 241

Proposed Fix:

The fix is to activate something like this in the mysql-[instance].service file [Service] LimitNOFILE=20000

systemd is, once again trying to take over system management in ways that other tools such as sysctl do better. And the defaults are set much too small.

nkadel-skyhook commented 7 years ago

A better location for the fix is

The fix is described well at:

nkadel-skyhook commented 7 years ago

An even better location for CentOS or RHEL 7 is:

github-actions[bot] commented 4 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

github-actions[bot] commented 4 years ago

Closing due to inactivity. If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.