0

There are large number of MySQL tables, it's more than thousands tables.

A few tables is accessed in short time, a large number of tables is accessed in long time. And it's shown many files opened a few hours ago in result of "lsof" command.

# lsof|grep mysql
mysqld    17986 18438 mysql  438uW  REG 259,1 147456  994052683 /var/lib/mysql/?????_db/wp_terms.ibd
...
# lsof|grep mysql|wc -l
85430 -> Many

It's not shown "Too many open files" error in MySQL.

Then I had changed the following MySQL parameters. However I can't decrease opened files in "lsof".

/etc/my.cnf

  • open_files_limit, table_open_cache, table_definition_cache, innodb_open_files

/usr/lib/systemd/system/mysqld.service

  • LimitNOFILE

Please tell me how to decrease many opened files by MySQL in "lsof" command? Or Should I ignore this result of "lsof" command?

Versions: MySQL - 8.0.21, lsof - 4.87

quenty658
  • 1,587
  • 2
  • 10
  • 7
  • lsof just shows you open filehandles. Are you trying to reduce the output of lsof, or are you just trying to fix the 'too many open files' error? Did changing the settings help? – Evert Mar 29 '23 at 03:42
  • What impact do you think a large number of open files has on your system? Can you measure it? – danblack Mar 29 '23 at 04:13
  • I'd like to decrease the output of lsof command. Reason: maintenance convenience, misunderstand, some kind of system performance. – quenty658 Mar 29 '23 at 08:17

0 Answers0