The table open cache

When a thread needs to access a table's physical file, a file descriptor is needed. To speed up the file access, MariaDB caches the file descriptors that are cached into the table open cache. This is even more useful if many MyISAM tables are contained in the same database. However, keep in mind that searching a file descriptor in this cache has a cost. If the cache cannot be big enough to contain all the needed descriptors, it could be better to disable it. A DBA may want to perform some tests to check whether table open cache is useful for a specific workload.

The table_open_cache server variable determines how many file descriptors are cached. This value should not exceed the maximum number of file descriptors allowed by the operating system, or the server may start to refuse new connections. On Unix systems, this number can be obtained with the following command:

ulimit -n

On other systems, if the ulimit command is not available, the system's documentation should be checked.

For the cache to contain all the needed descriptors, table_open_cache should be equal to the maximum number of simultaneous connections (the max_connections variable) multiplied by the maximum number of tables that can be referenced in a single statement. Also, remember to reserve some descriptors for the temporary tables. MyISAM and Aria tables need a descriptor for the index file, but that descriptor is shared among all connections.

If the server produces errors because it cannot open more files, the mysqld_safe --open-files-limit startup option should probably be set to a lower value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.37.151