I have just upgraded from MySQL Jessie 5.5 to MySQL Oracle Community Edition v5.6.
I have a particular MySQL server, that has around 230 DBs, and > 32k files/tables.
Whilst for two or three years, I had never noticeable problems with the Debian version, the services provided by this server failed a few hours after this upgrade.
Debugging the problem, I found out it was due to the limit of the open files per process.
I solved the problem raising the limits of the open files per process. I added to /etc/sysctl.conf:
fs.file-max=100000
and to /etc/security/limits.conf
* - nofile 100000
Afterwards I restarted MySQL, and that alone restored the normality of the services. For a document talking about this. http://duntuk.com/how-raise-ulimit-open-files-and-mysql-openfileslimit
From my own server:
mysql> show global variables like 'open%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| open_files_limit | 100000 |
+------------------+--------+
1 row in set (0.00 sec)
mysql> select @@table_open_cache;
+--------------------+
| @@table_open_cache |
+--------------------+
| 15000 |
+--------------------+
1 row in set (0.00 sec)
After solving the problem, I set out to find if there is any difference in the scripts or code between Debian´s and Oracle´s versions.
In my short analysis, I learnt they both have the open_files_limitin my.cnf and the option "--open-files-limit" in the script /usr/bin/mysqld_safe, which actually led me to find out the document/link I mentioned previously.
However, I did not find out anything more in the code or scripts that led me to justify the difference in behaviour concerning open files limits.
I can see also that in another server with MySQL 5.5 from Jessie the table_open_cache is actually lower.
mysql> select @@table_open_cache;
+--------------------+
| @@table_open_cache |
+--------------------+
| 512 |
+--------------------+
1 row in set (0.00 sec)
Whilst the default table_open_cache increasing could partly explain the problem, I am not sure if it fully justifies it.
Could someone shed some light on this?