Answer the question
In order to leave comments, you need to log in
How to fix Mysql error: 24 Too many open files?
Good afternoon!
Dedicated VPS server, OS Ubuntu 16.04.1 LTS, NGINX+APACHE+MYSQL. About 15 working sites (CMS Bitrix) are located on the server. Recently, the MySQL error: 24 Too many open files has become more frequent. Searching for information on Google, incl. and on the Toaster took the following actions:
1. Increased the limit of open files in the MySQL configuration: file my.cnf
section [mysqld] open_files_limit = 4098
2. Increased the limit in the system: file /etc/security/limits.conf
mysql soft nofile 24000
mysql hard nofile 32000
* soft nofile 24000
* hard nofile 32000
fs.file-max = 999999
mysql> show variables like 'open_files_limit';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| open_files_limit | 1024 |
+------------------+-------+
1 row in set (0.01 sec)
[email protected]:~# ulimit -Sn
1024
[email protected]:~# ulimit -Hn
4096
sudo lsof -u mysql | wc -l
986
Answer the question
In order to leave comments, you need to log in
As far as I understand, you already have systemd there.
And it is configured differently:
In the file /etc/systemd/system/multi-user.target.wants/mysql.service (I don’t remember exactly how the path looks in 16.4)
in the [Service] section, write LimitNOFILE=16384 (if necessary, the file and create a section! You can take some file from there as a template, cron.service, for example)
and
sudo systemctl daemon-reload
sudo systemctl restart mysql
/etc/systemd/system/multi-user.target.wants/mysql.service
[Service]
LimitNOFILE=999999
LimitNPROC=999999
TasksMax=infinity
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question