#StackBounty: #mysql #20.04 #systemd Cannot increase MySQL table_open_cache in Ubuntu 20.04

Bounty: 50

I’ve read both of these related questions and still stuck:

MySQL table_open_cache is set to 8000 in /etc/mysql/mysql.conf.d/mysqld.cnf and this value is not defined in any of the other loaded cnf files:

table_open_cache = 8000

Also, in /lib/systemd/system/mysql.service I have the default entry:

LimitNOFILE=10000

When I query variables from the cli I still get this:

mysql> show variables like 'table_open_cache';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| table_open_cache | 4745  |
+------------------+-------+

Also there’s this:

$ ulimit -n
1024

Which is confusing because if the open files limit was being restricted by system shouldn’t I be capped at 1024 instead of 4745? I don’t understand where 4745 is even coming from.

Can someone please explain what’s going on here? Is this a MySQL configuration problem or a limit being imposed by the operating system? I just migrated from Ubuntu 16.04 with nearly identical config and this was not a problem before.

OS is Ubuntu 20.04. MySQL version is 8.0.20.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.