I have some MySQL problems, I am not sure how to tune memory settings
From mysqltuner.pl:
>> MySQLTuner 1.3.0 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at MySQLTuner-perl by major
>> Run with '--help' for additional options and output filtering
[OK] Currently running supported MySQL version 5.6.16-log
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 7M (Tables: 61)
[--] Data in InnoDB tables: 84M (Tables: 2251)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52)
[!!] Total fragmented tables: 33
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 11d 0h 57m 2s (4M q [4.870 qps], 92K conn, TX: 11B, RX: 1B)
[--] Reads / Writes: 74% / 26%
[--] Total buffers: 12.6G global + 128.9M per thread (400 max threads)
[!!] Maximum possible memory usage: 63.0G (404% of installed RAM)
[OK] Slow queries: 0% (66/4M)
[OK] Highest usage of available connections: 4% (18/400)
[OK] Key buffer size / total MyISAM indexes: 256.0M/1.6M
[OK] Key buffer hit rate: 98.9% (553K cached / 6K reads)
[OK] Query cache efficiency: 67.9% (2M cached / 3M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (16 temp sorts / 86K sorts)
[!!] Joins performed without indexes: 4897
[!!] Temporary tables created on disk: 29% (82K on disk / 275K total)
[OK] Thread cache hit rate: 99% (18 created / 92K connections)
[!!] Table cache hit rate: 0% (2K open / 229K opened)
[OK] Open file limit used: 1% (151/9K)
[OK] Table locks acquired immediately: 99% (1M immediate / 1M locks)
[OK] InnoDB buffer pool / data size: 12.0G/84.8M
[OK] InnoDB log waits: 0
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Reduce your overall MySQL memory footprint for system stability
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
Read this before increasing table_cache over 64: table_cache negative scalability - MySQL Performance Blog
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
join_buffer_size (> 128.0M, or always use indexes with joins)
tmp_table_size (> 128M)
max_heap_table_size (> 128M)
table_cache (> 2000)
my.cfn:
[mysqld]
# InnoDB settings
innodb_buffer_pool_size=12G
innodb_log_file_size=2G
# Binary log/replication
log-bin
sync_binlog=1
sync_relay_log=1
relay-log-info-repository=TABLE
master-info-repository=TABLE
expire_logs_days=10
binlog_format=ROW
transaction-isolation=READ-COMMITTED
innodb_autoinc_lock_mode = 2
# Other
#timezone=GMT+1
character-set-server=utf8
collation-server=utf8_general_ci
max-connect-errors=100000
max-connections=500
open_files_limit=9708
query_cache_type=1
join_buffer_size=128M
tmp_table_size=128M
max_heap_table_size=128M
query_cache_limit=128M
key_buffer = 256M
query_cache_size = 256M
max_connections = 400
innodb_lock_wait_timeout = 100
I have server with 16GB ram and MySQL 5.6 I am not sure how to set it properly and ask for advice
Thanks
From mysqltuner.pl:
>> MySQLTuner 1.3.0 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at MySQLTuner-perl by major
>> Run with '--help' for additional options and output filtering
[OK] Currently running supported MySQL version 5.6.16-log
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 7M (Tables: 61)
[--] Data in InnoDB tables: 84M (Tables: 2251)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52)
[!!] Total fragmented tables: 33
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 11d 0h 57m 2s (4M q [4.870 qps], 92K conn, TX: 11B, RX: 1B)
[--] Reads / Writes: 74% / 26%
[--] Total buffers: 12.6G global + 128.9M per thread (400 max threads)
[!!] Maximum possible memory usage: 63.0G (404% of installed RAM)
[OK] Slow queries: 0% (66/4M)
[OK] Highest usage of available connections: 4% (18/400)
[OK] Key buffer size / total MyISAM indexes: 256.0M/1.6M
[OK] Key buffer hit rate: 98.9% (553K cached / 6K reads)
[OK] Query cache efficiency: 67.9% (2M cached / 3M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (16 temp sorts / 86K sorts)
[!!] Joins performed without indexes: 4897
[!!] Temporary tables created on disk: 29% (82K on disk / 275K total)
[OK] Thread cache hit rate: 99% (18 created / 92K connections)
[!!] Table cache hit rate: 0% (2K open / 229K opened)
[OK] Open file limit used: 1% (151/9K)
[OK] Table locks acquired immediately: 99% (1M immediate / 1M locks)
[OK] InnoDB buffer pool / data size: 12.0G/84.8M
[OK] InnoDB log waits: 0
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Reduce your overall MySQL memory footprint for system stability
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
Read this before increasing table_cache over 64: table_cache negative scalability - MySQL Performance Blog
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
join_buffer_size (> 128.0M, or always use indexes with joins)
tmp_table_size (> 128M)
max_heap_table_size (> 128M)
table_cache (> 2000)
my.cfn:
[mysqld]
# InnoDB settings
innodb_buffer_pool_size=12G
innodb_log_file_size=2G
# Binary log/replication
log-bin
sync_binlog=1
sync_relay_log=1
relay-log-info-repository=TABLE
master-info-repository=TABLE
expire_logs_days=10
binlog_format=ROW
transaction-isolation=READ-COMMITTED
innodb_autoinc_lock_mode = 2
# Other
#timezone=GMT+1
character-set-server=utf8
collation-server=utf8_general_ci
max-connect-errors=100000
max-connections=500
open_files_limit=9708
query_cache_type=1
join_buffer_size=128M
tmp_table_size=128M
max_heap_table_size=128M
query_cache_limit=128M
key_buffer = 256M
query_cache_size = 256M
max_connections = 400
innodb_lock_wait_timeout = 100
I have server with 16GB ram and MySQL 5.6 I am not sure how to set it properly and ask for advice
Thanks