How to increase max_open_files of mariadb in openwrt?

~# ulimit -Sn
1024

tried to modify /etc/security/limits.conf not work
tried to modify /etc/sysctl.conf not work
tried to create /etc/sysctl.d/60-file-max.conf not work

My objective is to get rid these warning :

Tue Jun 27 05:03:02 2023 daemon.err mysqld[3700]: 2023-06-27  5:03:02 0 [Note] /usr/bin/mysqld (server 10.6.10-MariaDB-log) starting as process 3700 ...
Tue Jun 27 05:03:02 2023 daemon.err mysqld[3700]: 2023-06-27  5:03:02 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 32186)
Tue Jun 27 05:03:02 2023 daemon.err mysqld[3700]: 2023-06-27  5:03:02 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
1 Like

ulimit -n 32768 seems to work, I only checked with ulimit -a.

Edit: fs.file-max is still set to 24595 for me when checking via sysctl -a. I can change this parameter using sysctl -w fs.file-max=32768 and sysctl -a reports it has been set.

You are aware that /etc/sysctl.d/60-file-max.conf is only applied when rebooting or restarting /etc/init.d/sysctl?

1 Like

sorry i just revise the question,
it seems i can increase the output of ulimit -Hn
but not the output of ulimit -Sn