MySQL Tuning: tmp_table_size and max_heap_table_size

Events happening in the community are now at Drupal community events on www.drupal.org.
Lloyd's picture

I'm switching over to a new server for my Drupal sites and am starting to tweak MySQL using tuning-primer and mysqltuner. I'm hosting on a VE server at Media Temple with (currently) 1GB of dedicated RAM. The database is currently MyISAM with no INNODB.

I'm continuing to get a recommendation from both tweaking programs to increase tmp_table_size and max_heap_table_size. I'm now up to 250MB. I'm wondering if this is fruitless and I'm dealing with the BLOB and TEXT column issue (not allowed in memory tables). The number of temp tables is increasing while I increasing the value of the settings, but the % created on disk is staying about the same at 26%.

I've included the results of tuning-primer.sh below and would appreciate any suggestions. I have some additional sites to move over and would like to get a handle on this issue. Thanks.

SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10 sec.
You have 0 out of 666413 that take longer than 10 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 4
Current threads_cached = 3
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 50
Current threads_connected = 2
Historic max_used_connections = 17
The number of used connections is 34% of the configured maximum.
Your max_connections variable seems to be fine.

No InnoDB Support Enabled!

MEMORY USAGE
Max Memory Ever Allocated : 168 M
Configured Max Per-thread Buffers : 231 M
Configured Max Global Buffers : 90 M
Configured Max Memory Limit : 321 M
Physical Memory : 1.71 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 15 M
Current key_buffer_size = 32 M
Key cache miss rate is 1 : 130
Key buffer free ratio = 67 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 48 M
Current query_cache_used = 18 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 38.37 %
Current query_cache_min_res_unit = 4 K
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 2.00 M
You have had 35 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.

Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.

OPEN FILES LIMIT
Current open_files_limit = 3060 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 1500 tables
You have a total of 1087 tables
You have 1108 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 250 M
Current tmp_table_size = 250 M
Of 7076 temp tables, 26% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 12 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 1777
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform
frequent updates consider setting 'low_priority_updates=1'
If you have a high concurrency of inserts on Dynamic row-length tables
consider setting 'concurrent_insert=2'.

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: