How many files does MySQL have open on Redhat Linux

Posted Oct 31, 2006

To tell how many files MySQL has open, you need to login as root and run one of the following commands:

# lsof | grep mysql

# lsof | grep mysqld

# lsof -c mysqld

# ls -l /proc/<PID>/fd  /* where <PID> is the process ID of the program you are interested in */

# lsof | grep "/var/lib/mysql"

You can tell how many files your OS has opened with this:

# cat /proc/sys/fs/file-max

On a MySQL client, you can run the following:

SHOW OPEN TABLES

To close the open files run:
FLUSH TABLES

Discussions

Comments are currently turned off

Latest Discussions

  • Carlos: Thank you!
    May 16, 2014 | Replies (0)
  • Jessica: Great info, thanks!
    May 15, 2014 | Replies (1)
  • Walter: Thanks, you totally saved me a bunch of searching around just now. I was setting up a percona xtradb...
    Feb 25, 2014 | Replies (0)
  • Avi: I've found the reason of the problem in my case. It's a bug as described here :http://bugs.mysql.com/bug.php?id=68892Shortly:...
    Dec 12, 2013 | Replies (0)
  • Avi: I've also met that behavior twice on 5.6.12 slaves. However, i didn't find the root cause of that....
    Dec 12, 2013 | Replies (0)