max_open_files cannot be changed

masterross

Well-Known Member
Apr 7, 2004
71
5
158
Hi,

It looks like mysql (10.1.37-MariaDB, WHM v76.0.18) doesnt accept max_open_files set in my.cnf
I have:
table_open_cache = 8000

but after restart when I check var:

MariaDB [(none)]> show global variables like 'table_open_cache';

+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| table_open_cache | 5325 |
+------------------+-------+
1 row in set (0.01 sec)

Also open_files_limit cannot be changed too!
I have set Allow cPanel & WHM to determine the best value for your MySQL open_files_limit configuration? to NO
But this not helping.

Any solution?

EDIT:
I found that if I need to change:
/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf
LimitNOFILE

and then
# systemctl daemon-reload
# systemctl restart mysql

i set LimitNOFILE=16000
And the table_open_cache also changed itself to 7825 automatically.

It's strange but it do the job.
 
Last edited:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,273
1,282
313
Houston
Hi @masterross

This is a setting that changed in CentOS 7 with systemd. I'm glad you found the solution and were able to implement it!

Thank you for letting us know how you resolved it.