Public bug reported:
With the default mysql-server installation on systemd versions of Ubuntu
(xenial and above) setting max_connections to more than 214 will not
work, due to systemd imposed limits:
root@juju-c2777d-default-1:~# grep max_connections
/etc/mysql/mysql.conf.d/mysqld_settings_charm.cnf
max_connections = 5500
root@juju-c2777d-default-1:~# grep max_connections /var/log/mysql/error.log
2017-10-05T12:41:16.958726Z 0 [Warning] Changed limits: max_connections: 214
(requested 5500)
2017-10-05T12:41:19.198391Z 0 [Warning] Changed limits: max_connections: 214
(requested 5500)
root@juju-c2777d-default-1:~# grep open_files /var/log/mysql/error.log
2017-10-05T12:41:11.824199Z 0 [Warning] Changed limits: max_open_files: 1024
(requested 5000)
2017-10-05T12:41:16.958668Z 0 [Warning] Changed limits: max_open_files: 1024
(requested 27500)
2017-10-05T12:41:19.198342Z 0 [Warning] Changed limits: max_open_files: 1024
(requested 27500)
As can be seen, mysql tries to increase the open files limit to 27500, but due
to systemd imposed limitation it fails to do so, and then it selects maximum
possible number of connections, based on open files limit.
This was the problem with default setups with pre-systemd installs, but upstart
allowed mysqld to change the limit of open files before mysqld drops privileges
from root to mysql system user.
Even before that, on sysV init, there was a wrapper, mysqld_safe, which run as
root, used ulimit to change the open files limit and then started mysqld as
mysql user.
Would it make sense to ship mysql-server packages with mysql.service unit files
so that there is no limit for open files, or so that open files limit is
substantially higher than 1024?
This was all discussed when Ubuntu 15.10 came out, for mysql-5.6, in bug
LP: #1434758, but I am still bringing this up for more recent mysql
versions.
** Affects: mysql-5.7 (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1721546
Title:
max open files limit prevents max_connections over 214 on systemd
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1721546/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs