![]() | |
#1
| |||
| |||
|
|
MySQLTuner 1.1.1 - Major Hayden <major (AT) mhtx (DOT) net Bug reports, feature requests, and downloads at http://mysqltuner.com/ Run with '--help' for additional options and output filtering |
#2
| |||
| |||
|
|
I'm using mysqltuner.pl for some time now, and i'm confused by the output of it, can someone give some more insight? There is: "Variables to adjust: table_cache (> 32752)" which contradicts (to me) with: "[!!] Table cache hit rate: 11% (1K open / 11K opened)" I whish to say thanks if you have a nice comment about this... |
#3
| |||
| |||
|
|
On 2011-01-08 11:00, Luuk wrote: I'm using mysqltuner.pl for some time now, and i'm confused by the output of it, can someone give some more insight? There is: "Variables to adjust: table_cache (> 32752)" which contradicts (to me) with: "[!!] Table cache hit rate: 11% (1K open / 11K opened)" I whish to say thanks if you have a nice comment about this... My interpretation of the output [1], is that 11% (poor hit ratio) of the data is found in the cache. If you increase the size of the cache (above 32752), the hit ratio will probably increase. That said, a poor hit ratio is not necessary due to an insufficient size of the cache. If you are doing table scans in your queries, you will effectively lower the hit ratio. /Lennart [1] I have never used the tool, and my knowledge regarding tuning of mysql is very limited. |
#4
| |||
| |||
|
|
I'm using mysqltuner.pl for some time now, and i'm confused by the output of it, can someone give some more insight? There is: "Variables to adjust: table_cache (> 32752)" which contradicts (to me) with: "[!!] Table cache hit rate: 11% (1K open / 11K opened)" |
#5
| ||||
| ||||
|
|
Luuk <Luuk (AT) invalid (DOT) lan> wrote: I'm using mysqltuner.pl for some time now, and i'm confused by the output of it, can someone give some more insight? There is: "Variables to adjust: table_cache (> 32752)" which contradicts (to me) with: "[!!] Table cache hit rate: 11% (1K open / 11K opened)" Where do you see a contradiction? I'm not sure what "(> 32752)" is trying to tell us, but [!!] Table cache hit rate: 11% (1K open / 11K opened) is pretty clear. Seems you have 1K tables open (this would then be your current value for table_open_cache) but MySQL had to do 11K table-open operations (in the last UPTIME seconds). Increasing table_open_cache could reduce the number of those, rather costly, operations. http://dev.mysql.com/doc/refman/5.1/...ble_open_cache |
|
Com_ha_open | 0 | Com_show_open_tables | 0 | Open_files | 2203 | Open_streams | 0 | Open_tables | 1311 | Opened_tables | 11416 | Slave_open_temp_tables | 0 | |
|
IMHO it makes more sense to look at (tables_opened / uptime). Unless you have >1 table-open op per second, this is not a problem. Common values are even lower, below 1/min. But this depends on your data model and usage pattern. |
| XL |
#6
| |||
| |||
|
|
On 08-01-11 11:27, Lennart Jonsson wrote: On 2011-01-08 11:00, Luuk wrote: I'm using mysqltuner.pl for some time now, and i'm confused by the output of it, can someone give some more insight? There is: "Variables to adjust: table_cache (> 32752)" which contradicts (to me) with: "[!!] Table cache hit rate: 11% (1K open / 11K opened)" I whish to say thanks if you have a nice comment about this... My interpretation of the output [1], is that 11% (poor hit ratio) of the data is found in the cache. If you increase the size of the cache (above 32752), the hit ratio will probably increase. That said, a poor hit ratio is not necessary due to an insufficient size of the cache. If you are doing table scans in your queries, you will effectively lower the hit ratio. /Lennart [1] I have never used the tool, and my knowledge regarding tuning of mysql is very limited. If i have in my.cnf 'query_cache_size = 128M', and only 11% of it is used, it might be that more will be used when i increase the value But if the poor ratio is because of tablescans, i might as well change the value to 14M or 15M (11% of 128M), which should give the same performance as now, with less memory needs? |
#7
| ||||
| ||||
|
|
On 08-01-11 11:41, Axel Schwenke wrote: http://dev.mysql.com/doc/refman/5.1/...ble_open_cache This seems to be true, only 'table_open_cache' was introduced in 5.1, and i'm still using 5.0.x |
|
"If the value of Opened_tables is large and you do not use FLUSH TABLES often (which just forces all tables to be closed and reopened), then you should increase the value of the table_cache variable." When i see this value 1311, and my table_cache is at 40960, i dont see the need to increase that value. |
|
IMHO it makes more sense to look at (tables_opened / uptime). tables_opened / uptime = 11416 / 1807169 = 0.0063 |
|
For now i will double the table_cache (from 128M to 256M) |
#8
| |||
| |||
|
|
I might be confusing 'table_cache' (40960) with 'query_cache_size' (128M) here. |
#9
| |||
| |||
|
|
Luuk <Luuk (AT) invalid (DOT) lan> wrote: On 08-01-11 11:41, Axel Schwenke wrote: http://dev.mysql.com/doc/refman/5.1/...ble_open_cache This seems to be true, only 'table_open_cache' was introduced in 5.1, and i'm still using 5.0.x Right. The variable is called table_cache then, but the meaning is the same. The new name was introduced because in 5.1 there are now two table related caches: table_open_cache and table_definition_cache and the new naming schema is more clear. "If the value of Opened_tables is large and you do not use FLUSH TABLES often (which just forces all tables to be closed and reopened), then you should increase the value of the table_cache variable." When i see this value 1311, and my table_cache is at 40960, i dont see the need to increase that value. Yeah. In fact it seems to be quite large already. If there were 11K table-open operations, they could have been for at most 11K tables. But since only 1K of your cache is used, it's pretty clear that you never had more than said 1K tables open concurrently and that you can in fact reduce the table_cache without adverse effects. As Lennart said: a bad cache hit ratio not necessarily means that the cache is too small. However: you should check (SHOW GLOBAL VARIABLES) that MySQL indeed uses the 40K from your my.cnf. Table cache size is related to file descriptors. If MySQL is unable to set the file handle limit (calculated as 2*table_cache + max_connections + 10), it will automatically decrease table_cache and/or max_connections and write a warning to the error log. I believe now that indeed MySQL could not reserve enough file handles and thus decreased table_cache to 32752. However this is still very big |
|
IMHO it makes more sense to look at (tables_opened / uptime). tables_opened / uptime = 11416 / 1807169 = 0.0063 Yeah. Certainly not a problem at all. For now i will double the table_cache (from 128M to 256M) For heavens sake, no! I suggest to decrease table cache to ~4K. |
| XL |
#10
| |||
| |||
|
|
On 08-01-11 14:04, Axel Schwenke wrote: Luuk <Luuk (AT) invalid (DOT) lan> wrote: On 08-01-11 11:41, Axel Schwenke wrote: http://dev.mysql.com/doc/refman/5.1/...ble_open_cache This seems to be true, only 'table_open_cache' was introduced in 5.1, and i'm still using 5.0.x Right. The variable is called table_cache then, but the meaning is the same. The new name was introduced because in 5.1 there are now two table related caches: table_open_cache and table_definition_cache and the new naming schema is more clear. "If the value of Opened_tables is large and you do not use FLUSH TABLES often (which just forces all tables to be closed and reopened), then you should increase the value of the table_cache variable." When i see this value 1311, and my table_cache is at 40960, i dont see the need to increase that value. Yeah. In fact it seems to be quite large already. If there were 11K table-open operations, they could have been for at most 11K tables. But since only 1K of your cache is used, it's pretty clear that you never had more than said 1K tables open concurrently and that you can in fact reduce the table_cache without adverse effects. As Lennart said: a bad cache hit ratio not necessarily means that the cache is too small. However: you should check (SHOW GLOBAL VARIABLES) that MySQL indeed uses the 40K from your my.cnf. Table cache size is related to file descriptors. If MySQL is unable to set the file handle limit (calculated as 2*table_cache + max_connections + 10), it will automatically decrease table_cache and/or max_connections and write a warning to the error log. I believe now that indeed MySQL could not reserve enough file handles and thus decreased table_cache to 32752. However this is still very big indeed, its 32752 according to 'SHOW GLOBAL VARIABLES' |
|
IMHO it makes more sense to look at (tables_opened / uptime). tables_opened / uptime = 11416 / 1807169 = 0.0063 Yeah. Certainly not a problem at all. For now i will double the table_cache (from 128M to 256M) For heavens sake, no! I suggest to decrease table cache to ~4K. Oops, i should have delete that sentence, but it happened when i found out that i had a mix up between 'table_cache' and 'query_cache_size'.... XL |
![]() |
| Thread Tools | |
| Display Modes | |
| |