Mysql is very slow: too many open files

Created:

2016-11-16 12:45:16 UTC

Modified:

2017-08-08 13:43:33 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Mysql is very slow: too many open files

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

Mysql operates very slow. The following in mysql log:

2016-06-18 11:46:24 4338 [ERROR] /usr/sbin/mysqld: Can't open file: './19915082_hd_multi4/ic1_history.frm' (errno: 24 - Too many open files) 
2016-06-18 11:46:24 4338 [ERROR] /usr/sbin/mysqld: Can't open file: './19915082_hd_multi4/ic1_kalender.frm' (errno: 24 - Too many open files)
2016-06-18 11:46:24 4338 [ERROR] /usr/sbin/mysqld: Can't open file: './19915082_hd_multi4/ic1_kasse.frm' (errno: 24 - Too many open files)

The follwoing in /var/log/syslog :

Jun 18 06:47:10 sr55 kernel: [10417803.858325] type=1400 audit(1466225230.611:665): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/58657/status" pid=58657 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0 
Jun 18 06:47:10 sr55 kernel: [10417803.858384] type=1400 audit(1466225230.611:666): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=58657 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
Jun 18 06:47:10 sr55 kernel: [10417803.858454] type=1400 audit(1466225230.611:667): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/58657/status" pid=58657 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=0 ouid=0

Cause

Apparmor is enabled on the server.

Resolution

  • Disable apparmor on the server according to KB # 112903

  • Or disable the MySQL profile in apparmor configuration:

    # ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
    # apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld

Check if it is disabled:

    # aa-status
Have more questions? Submit a request
Please sign in to leave a comment.