How many files does MySQL have open on Redhat Linux

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

Comments

New Comment