max-connections cannot be raised over 4190

Bug #1905366 reported by Trent Lloyd
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Percona Cluster Charm
Fix Released
Undecided
Trent Lloyd

Bug Description

If you set max-connections to a value larger than 4190, it will not be honored. The reason is that MySQL caps the max_connections limit based on the value of open_files_limit, the "nofile" ulimit.

On bionic percona-cluster-5.7 LimitNOFile is hardset in the unit to 5000 and the charm has no code to set an override. This seems to be a change over xenial where this setting worked.

This is also report in /var/log/mysql/error.log:
2020-11-24T08:11:38.888629Z 0 [Warning] Changed limits: max_connections: 4190 (requested 12000)

We need to set an override.conf for LimitNOFile with max_connections > 4190 to allow for the setting to take effect - this is a limit being hit in practice with larger OpenStack deployments.

Further background: https://www.percona.com/blog/2017/10/12/open_files_limit-mystery/

Tags: sts
Trent Lloyd (lathiat)
tags: added: sts
Revision history for this message
Trent Lloyd (lathiat) wrote :

The following neutron-api bug is related to this, it is common to have neutron-api making 400-1600 connections per node consuming either a large part of all of this limit in 3 node HA setups:
https://bugs.launchpad.net/charm-neutron-api/+bug/1905810

Trent Lloyd (lathiat)
Changed in charm-percona-cluster:
assignee: nobody → Trent Lloyd (lathiat)
status: New → Confirmed
Revision history for this message
Trent Lloyd (lathiat) wrote :
Trent Lloyd (lathiat)
Changed in charm-percona-cluster:
status: Confirmed → In Progress
Revision history for this message
Trent Lloyd (lathiat) wrote :

Released in 21.01

Changed in charm-percona-cluster:
status: In Progress → Fix Released
Revision history for this message
Trent Lloyd (lathiat) wrote :

This appears to have been merged, and released in 21.01. Can someone update the milestone?

Changed in charm-percona-cluster:
milestone: none → 21.01
Revision history for this message
Shunde Zhang (shunde-zhang) wrote :

This fix adds an override file /etc/systemd/system/mysql.service.d/charm-nofile.conf
This is fine if percona cluster already exists and the max connection config is set to a new value.

However, if a new percona cluster is created with a max connection value, this override file is not used because when the percona cluster is created and started for the first time, the started service is <email address hidden>, therefore the override file it uses is /etc/systemd/system/mysql@.service.d/charm-nofile.conf, which has a '@' symbol in the path.

This is how it looks like when a new percona cluster is just created.

root@juju-fb8079-ost-3:~# systemctl status mysql
● mysql.service - Percona XtraDB Cluster daemon
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mysql.service.d
           └─charm-nofile.conf
   Active: inactive (dead) since Thu 2021-07-01 00:42:27 UTC; 10min ago
  Process: 1932 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
 Main PID: 512 (code=exited, status=0/SUCCESS)

root@juju-fb8079-ost-3:~# systemctl status <email address hidden>
● <email address hidden> - Percona XtraDB Cluster daemon with config /etc/default/mysql.bootstrap
   Loaded: loaded (/lib/systemd/system/mysql@.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-07-01 00:42:34 UTC; 11min ago
  Process: 2145 ExecStart=/etc/init.d/mysql start ${EXTRA_ARGS} (code=exited, status=0/SUCCESS)
  Process: 2043 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 2185 (mysqld_safe)
    Tasks: 102 (limit: 4703)
   CGroup: /<email address hidden>
           ├─2185 /bin/sh /usr/bin/mysqld_safe --wsrep-new-cluster
           └─2808 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/percona-xtradb-cluster --plugin-dir=/usr/lib/mysql/plugin --wsrep-provider=/usr/lib/galera3/libgalera_smm.so --

Maybe the charm should create /etc/systemd/system/mysql@.service.d/charm-nofile.conf too?

Revision history for this message
Shunde Zhang (shunde-zhang) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.