Open files in MysqlErrcode 24

Open files in MysqlErrcode 24

You will be seeing this error message in the error log of mysql:

Code:
Error: SQLSTATE[HY000]: General error: 23 Out of resources when opening file ‘/tmp/#***.MYD’ (Errcode: 24 – Too many open files)
[ERROR] /usr/sbin/mysqld: Can’t open file: ‘./usr_web587_1/etqvi_languages.frm’ (errno: 24 – Too many open files)
Failed to process database ‘wordpress_f’ from domain ‘example.com’: MySQL error 1018: Can’t read dir of ‘./wordpress_f/’ (errno: 24 “Too many open files”) executing query: SHOW TABLE STATUS FROM `wordpress_f`
[ERROR] Error in accept: Too many open files
DB query failed: SQLSTATE[HY000]: General error: 1016 Can’t open file: ‘./psa/misc.frm’ (errno: 24), query was: select param, val from misc
Also, in the log files, you might see error messages more responsive from the service of MySQL:

Code:
/var/log/plesk/panel.log
/var/log/mysql/error.log
/var/log/mariadb/mariadb.log
/var/log/syslog
  • It is not possible to calculate the statistics of data usage using the listed errors.
  • In regular intervals, you can see the service of MySQL goes down
  • Loading of Plesk fails sometimes or failure of database operation in MySQL.
Code:
ERROR: PleskDBException: Unable to connect to database: mysql_connect(): MySQL server has gone away (Error code: 2006) (Abstract.php:69)
DB query failed: SQLSTATE[HY000]: General error: 23 Out of resources when opening file ‘/tmp/#sql_2ff_0.MAI’ (Errcode: 24 “Too many open files”), query was: DESCRIBE `sessions`
Using the below warning, create the backup of Plesk:

Code:
WARNING : (mysql object ‘johndoe_opencart_e’) Not all the data was backed up into /var/lib/psa/dumps/clients/john_doe/domains/example.com/databases/johndoe_opencart_e_1 successfully. mysqldump: Couldn’t execute ‘show table status like ‘address”: Can’t read dir of ‘./john_doe_opencart_e/’ (errno: 24 – Too many open files) (1018)
If you are trying to open the files in MySQL, the system gets failed and hangs up so that it tries to stop the process of MySQL.

Let us see the solution and steps:

Along with the installation of MariaDB:

Step 1: Use SSH, and start connecting to the server. Use the below script, to make changes in the script of MariaDB:

Code:
# systemctl edit mariadb
Step 2: Now, set the limit of open files in service of MariaDB:

Code:
[Service]
LimitNOFILE=8192
Step 3: Do restart the service of MariaDB:

Code:
# systemctl restart mariadb
Step 4: Just verify the changes you made:

Code:
# egrep “open files” /proc/$(cat `pleskdb -Ne “show variables like ‘pid_file'” | awk ‘{print $2}’`)/limits
Max open files 8192 8192 files
Along with the installation of MySQL:

Step 1:
Use SSH, to get connected with the server. To make changes in the script of MySQL:

Code:
# systemctl edit mysql
Step 2: In MySQL service, start setting up the limitation of open files:

Code:
[Service]
LimitNOFILE=8192
Step 3: Do restart of MySQL service:

Code:
# systemctl restart mysql
Step 4: Just verify the changes you made:

Code:
# egrep “open files” /proc/$(cat `pleskdb -Ne “show variables like ‘pid_file'” | awk ‘{print $2}’`)/limits
Max open files 8192 8192 files
Method 3:

Step 1:
Start editing the /etc/init.d/mysqld. At the top, just check the statement #!/bin/sh and then add the below mentioned

Code:
ulimit -HSn 1024
ulimit -HSn 32768
ulimit -HSn 1024000
If you find the value is higher than the limit, just try to delete or try minimize the value.

Step 2: Go to /etc/my.cnf. Below the section of [mysqld], check whether there is an open file limit value. If yes, increase the value by below-mentioned command:

Code:
open_files_limit=32768
Once done, do mysqld restart!

Step 3: Check the value is increased in the open file limit value just running out the query of SQL:

‘open%’; Just cross-check with the query.
Author
kumkumsharma
Views
132
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top