• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Not enough filehandles during back-up for mysqldump

mr-wolf

Silver Pleskian
Plesk Guru
All of a sudden I'm getting:

Warning: mysql "upgrade_"
Not all the data was backed up into /var/lib/psa/dumps/clients/artitec/domains/xxxxx/databases/upgrade__1 successfully. mysqldump: Got error: 23: Out of resources when opening file './upgrade_/art_zoo_category_item.MYD' (Errcode: 24 - Too many open files) when using LOCK TABLES

AFAIK nothing has changed lately to this database.
It happened the last 3 back-ups. All was fine the days before.
2 weeks ago this site was on another server, so I don't care much about that change.
I want to focus on how to get this permanently resolved by increasing the amount of file handles.

I tested the amount of files I'm able to open and that's 1024
Code:
mysql> SHOW VARIABLES LIKE 'open%';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 1024  |
+------------------+-------+
1 row in set (0.00 sec)

On the previous server this was

Code:
mysql> SHOW VARIABLES LIKE 'open%';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 2458  |
+------------------+-------+
1 row in set (0.00 sec)

I expected a quick fix after I found this page:
Error: 'Out of resources when opening file '/tmp/#sql_390d_2.MYD' (Errcode: 24 - Too many open files)' when trying to dump tablespaces

Alas, no.... :(:(

At first I wanted to do clean and elegant by adding a new file named "open_files.cnf" into
/etc/mysql/mysql.conf.d
But when that didn't work I directly edited the mysqld.cnf that was there.
After restarting mysql that limit stayed 1024. :(:(:(:(

It's an Ubuntu 16.04 TLS with Plesk Onyx 17.0.17
Is there maybe some other setting that is stopping it from increasing the filehandles??
This one is a pre-installed Plesk from a big German provider.

I think that the database that's causing this error is superfluous, so maybe getting rid of it is a solution, but on the other hand it intrigues me why the amount of files doesn't change and is so much lower than that of the other server.
 
Last edited:
FOUND IT :cool::cool::cool:

The explanation can be found here:
Can not increase max_open_files for Mysql max-connections in Ubuntu 15

The last post is what I implemented and that worked.
I doubled it to open files to 2048 and I will see how it works out for the back-up

Thanks Fredrick on stackoverflow.com:
Fredrick said:
As of MySQL 5.7.7, this is what the documentation recommends for Red Hat Enterprise Linux 7, Oracle Linux 7, CentOS 7, SUSE Linux Enterprise Server 12, Fedora 24 and 25:

MySQL :: MySQL 5.7 Reference Manual :: 2.5.10 Managing MySQL Server with systemd

On Ubuntu 16.04 the service is called mysql, not mysqld, so this is what I did:

sudo mkdir /etc/systemd/system/mysql.service.d
sudo vi /etc/systemd/system/mysql.service.d/override.conf
Added this in the new file override.conf:

[Service]
LimitNOFILE=5000
Then restarted the service:

sudo systemctl daemon-reload
sudo systemctl restart mysql
 
Last edited:
Back
Top