Comment 5 for bug 1673712

Revision history for this message
Agustín (agustin-gallego) wrote :

Added upstream bug related to this.

root@VM-ubuntu14:~# echo "mysql soft nofile 1048576" >> /etc/security/limits.conf
root@VM-ubuntu14:~# echo "mysql hard nofile 1048576" >> /etc/security/limits.conf
root@VM-ubuntu14:~# su mysql --shell /bin/bash --command "ulimit -Hn; ulimit -Sn"
4096
1024
root@VM-ubuntu14:~# echo "open-files-limit=1024000" >> /etc/mysql/mysql.conf.d/mysqld.cnf
root@VM-ubuntu14:~# service mysql stop
...
 * MySQL Community Server 5.7.18 is stopped
root@VM-ubuntu14:~#
root@VM-ubuntu14:~# mv /var/log/mysql/error.log /var/log/mysql/error.log.bak
root@VM-ubuntu14:~#
root@VM-ubuntu14:~# service mysql start
..
 * MySQL Community Server 5.7.18 is started
root@VM-ubuntu14:~# cat /var/log/mysql/error.log | grep -C2 "\[Warning\]" | grep open
2017-05-19T18:00:33.161322Z 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 1024000)
2017-05-19T18:00:33.161819Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
root@VM-ubuntu14:~# mysql -u root -e "show variables like '%open_files%';"
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| innodb_open_files | 431 |
| open_files_limit | 1024 |
+-------------------+-------+
root@VM-ubuntu14:~# echo "session required pam_limits.so" >> /etc/pam.d/common-session
root@VM-ubuntu14:~# service mysql stop
...
 * MySQL Community Server 5.7.18 is stopped
root@VM-ubuntu14:~#
root@VM-ubuntu14:~# mv /var/log/mysql/error.log /var/log/mysql/error.log.bak.2
root@VM-ubuntu14:~# service mysql start
..
 * MySQL Community Server 5.7.18 is started
root@VM-ubuntu14:~#
root@VM-ubuntu14:~#
root@VM-ubuntu14:~# cat /var/log/mysql/error.log | grep -C2 "\[Warning\]" | grep open
root@VM-ubuntu14:~# mysql -u root -e "show variables like '%open_files%';"
+-------------------+---------+
| Variable_name | Value |
+-------------------+---------+
| innodb_open_files | 2000 |
| open_files_limit | 1048576 |
+-------------------+---------+
root@VM-ubuntu14:~# mysql -u root -e "show variables like '%version%';"
+-------------------------+------------------------------+
| Variable_name | Value |
+-------------------------+------------------------------+
| innodb_version | 5.7.18 |
| protocol_version | 10 |
| slave_type_conversions | |
| tls_version | TLSv1,TLSv1.1 |
| version | 5.7.18 |
| version_comment | MySQL Community Server (GPL) |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
+-------------------------+------------------------------+