Abrir tabelas no MySQL?

1

Para o mysql, tenho as seguintes tabelas:

[--] Data in MyISAM tables: 110M (Tables: 254)
[--] Data in InnoDB tables: 32M (Tables: 134)
[--] Data in MEMORY tables: 0B (Tables: 3)

mas

[!!] Table cache hit rate: 19% (400 open / 2K opened)

Eu coloquei 400 como cache de tabela porque tenho menos de 400 tabelas. Como isso funciona e o que devo fazer?

    
por Tim 10.02.2010 / 19:16

1 resposta

1

Consulte a página MySQL em tabelas abertas e fechadas

MySQL is multi-threaded, so there may be many clients issuing queries for a given table simultaneously. To minimize the problem with multiple client sessions having different states on the same table, the table is opened independently by each concurrent session.

table_cache is related to max_connections. For example, for 200 concurrent running connections, you should have a table cache size of at least 200 × N, where N is the maximum number of tables per join in any of the queries which you execute. You must also reserve some extra file descriptors for temporary tables and files.

You can determine whether your table cache is too small by checking the mysqld status variable Opened_tables, which indicates the number of table-opening operations since the server started:

SHOW GLOBAL STATUS LIKE 'Opened_tables';

If the value is very large or increases rapidly, even when you have not issued many FLUSH TABLES statements, you should increase the table cache size.

    
por 10.02.2010 / 22:00

Tags