max open files limit prevents max_connections over 214 on systemd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-5.7 (Ubuntu) |
Fix Released
|
Undecided
|
Mario Splivalo | ||
Xenial |
Confirmed
|
Undecided
|
Mario Splivalo | ||
Zesty |
Confirmed
|
Undecided
|
Mario Splivalo | ||
Artful |
Confirmed
|
Undecided
|
Mario Splivalo |
Bug Description
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-
max_connections = 5500
root@juju-
2017-10-
2017-10-
root@juju-
2017-10-
2017-10-
2017-10-
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.
tags: | added: sts |
Changed in mysql-5.7 (Ubuntu Artful): | |
assignee: | nobody → Mario Splivalo (mariosplivalo) |
Changed in mysql-5.7 (Ubuntu Zesty): | |
assignee: | nobody → Mario Splivalo (mariosplivalo) |
Changed in mysql-5.7 (Ubuntu Xenial): | |
assignee: | nobody → Mario Splivalo (mariosplivalo) |
Status changed to 'Confirmed' because the bug affects multiple users.