Help with MySQLTuner on E3-1240 / 24GB

tone

Member
Oct 20, 2010
16
0
51
Server Specifications:

Xeon E3-1240
24GB DDR3
2x2TB RAID 1
1Gbps unmetered

I'm not entirely sure, and not at all knowledgeable, about mysql optimisation - I was hoping someone on here might be able to tell me the best my.cnf to set.

Here are the results from MySQLTuner

Code:
 >>  MySQLTuner 1.2.0_1 - Major Hayden <[email protected]>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering

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

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 194M (Tables: 984)
[--] Data in InnoDB tables: 780M (Tables: 1528)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[--] Data in MEMORY tables: 372K (Tables: 24)
[!!] Total fragmented tables: 127

-------- Performance Metrics -------------------------------------------------
[--] Up for: 5m 29s (6K q [18.745 qps], 418 conn, TX: 314M, RX: 2M)
[--] Reads / Writes: 84% / 16%
[--] Total buffers: 3.0G global + 2.8M per thread (5000 max threads)
[OK] Maximum possible memory usage: 16.4G (70% of installed RAM)
[OK] Slow queries: 0% (0/6K)
[OK] Highest usage of available connections: 0% (5/5000)
[OK] Key buffer size / total MyISAM indexes: 1.0G/53.7M
[OK] Key buffer hit rate: 99.5% (165K cached / 839 reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 1K sorts)
[!!] Joins performed without indexes: 52
[!!] Temporary tables created on disk: 47% (331 on disk / 697 total)
[!!] Thread cache is disabled
[OK] Table cache hit rate: 96% (172 open / 179 opened)
[OK] Open file limit used: 0% (82/25K)
[OK] Table locks acquired immediately: 100% (7K immediate / 7K locks)
[OK] InnoDB data size / buffer pool: 780.3M/2.0G

-------- 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
    Set thread_cache_size to 4 as a starting value
Variables to adjust:
    query_cache_size (>= 8M)
    join_buffer_size (> 128.0K, or always use indexes with joins)
    tmp_table_size (> 16M)
    max_heap_table_size (> 16M)
    thread_cache_size (start at 4)
And here is my current my.cnf

Code:
[mysqld]
local-infile=0
innodb_file_per_table=1
default-storage-engine=MyISAM
key_buffer_size=1024M
max_connections=5000
innodb_buffer_pool_size=2028M
Appreciate anyone who takes the time to look and advise, thank you.
 

kernow

Well-Known Member
Jul 23, 2004
1,020
62
178
cPanel Access Level
Root Administrator
The most important line in the mysqltuner comment you posted is this:
MySQL started within last 24 hours - recommendations may be inaccurate
You can't hope to get a clear picture using mysqltuner until your server has been running at least 24 hours, preferably 48 hours.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

Yes, please let us know the output after MySQL has been running longer than 24 hours.

Thank you.
 

tone

Member
Oct 20, 2010
16
0
51
Here's an updated version after letting it run for longer:

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

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 211M (Tables: 950)
[--] Data in InnoDB tables: 836M (Tables: 1522)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[--] Data in MEMORY tables: 497K (Tables: 24)
[!!] Total fragmented tables: 130

-------- Performance Metrics -------------------------------------------------
[--] Up for: 3d 9h 38m 31s (8M q [27.759 qps], 438K conn, TX: 376B, RX: 3B)
[--] Reads / Writes: 86% / 14%
[--] Total buffers: 2.0G global + 2.8M per thread (5000 max threads)
[OK] Maximum possible memory usage: 15.5G (66% of installed RAM)
[OK] Slow queries: 0% (1K/8M)
[OK] Highest usage of available connections: 4% (229/5000)
[OK] Key buffer size / total MyISAM indexes: 8.0M/59.2M
[OK] Key buffer hit rate: 99.8% (53M cached / 119K reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (36 temp sorts / 1M sorts)
[!!] Joins performed without indexes: 56537
[!!] Temporary tables created on disk: 43% (190K on disk / 434K total)
[OK] Thread cache hit rate: 99% (229 created / 438K connections)
[!!] Table cache hit rate: 0% (400 open / 79K opened)
[OK] Open file limit used: 0% (177/25K)
[OK] Table locks acquired immediately: 99% (10M immediate / 10M locks)
[OK] InnoDB data size / buffer pool: 836.5M/2.0G

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    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
    Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
    query_cache_size (>= 8M)
    join_buffer_size (> 128.0K, or always use indexes with joins)
    tmp_table_size (> 16M)
    max_heap_table_size (> 16M)
    table_cache (> 400)