Best config to lower Temporary table disk usage?

Started by wnff_chief, December 17, 2009, 10:06:12 AM

Previous topic - Next topic

wnff_chief

I often find mysqltuner.pl and status.php reporting undesirable levels of temporary table disk usage and while my forum runs fine, this one un-optimized thing is driving me nuts, and I'm unable to seemingly do anything about it via adjusting the variables suggested by mysqltuner.

http://www.wnff.net/status.php

Apologies for the "less than 24 hours" tuner data, but most of the results actually look pretty similar to what it usually looks like after 1-2 days anyway (aside from the obvious stuff like open files)

MYSQLTUNER

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.77
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 207M (Tables: 18)
[--] Data in InnoDB tables: 18M (Tables: 21)
[--] Data in MEMORY tables: 248K (Tables: 2)
[!!] Total fragmented tables: 1

-------- Performance Metrics -------------------------------------------------
[--] Up for: 16m 3s (17K q [17.796 qps], 813 conn, TX: 25M, RX: 4M)
[--] Reads / Writes: 57% / 43%
[--] Total buffers: 145.0M global + 2.7M per thread (100 max threads)
[OK] Maximum possible memory usage: 420.0M (20% of installed RAM)
[OK] Slow queries: 0% (0/17K)
[OK] Highest usage of available connections: 6% (6/100)
[OK] Key buffer size / total MyISAM indexes: 64.0M/44.9M
[OK] Key buffer hit rate: 98.3% (127K cached / 2K reads)
[OK] Query cache efficiency: 48.5% (5K cached / 10K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 104 sorts)
[!!] Joins performed without indexes: 9
[!!] Temporary tables created on disk: 44% (17 on disk / 38 total)
[/color]
[OK] Thread cache hit rate: 99% (6 created / 813 connections)
[OK] Table cache hit rate: 67% (46 open / 68 opened)
[OK] Open file limit used: 1% (43/2K)
[OK] Table locks acquired immediately: 99% (18K immediate / 18K locks)
[OK] InnoDB data size / buffer pool: 18.1M/24.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Enable the slow query log to troubleshoot bad queries
    Adjust your join queries to always utilize indexes
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
    join_buffer_size (> 128.0K, or always use indexes with joins)
    tmp_table_size (> 32M)
    max_heap_table_size (> 16M)


MY.CNF

skip-networking

skip-bdb

set-variable = innodb_flush_log_at_trx_commit=0
set-variable = innodb_flush_method=O_DIRECT
set-variable = innodb_buffer_pool_size=24M
set-variable = key_buffer_size=64M
set-variable = query_cache_size=40M
set-variable = table_cache=1024
set-variable = thread_cache_size=30
#set-variable = max_heap_table_size=64M <=
#set-variable = tmp_table_size=64M <==  Have tried everything from default up to 128MB/128MB for these values with no apparent difference

set-variable = innodb_additional_mem_pool_size=500K
set-variable = innodb_log_buffer_size=500K
set-variable = innodb_thread_concurrency=2

Something like that

Running SMF 2.0 will dramatically reduce the number of temporarily tables (better queries are used).

The advice in this thread will help: http://www.simplemachines.org/community/index.php?topic=336278.0

But I see you've already done that. :)

wnff_chief

Quote from: Mark Rose on December 18, 2009, 04:41:27 PM
Running SMF 2.0 will dramatically reduce the number of temporarily tables (better queries are used).

The advice in this thread will help: http://www.simplemachines.org/community/index.php?topic=336278.0

But I see you've already done that. :)

Yep just did that earlier this afternoon and it seems to have helped nicely.  Thanks very much! :)

Advertisement: