Hi,
I am new member in this forum. I hope I can learn a lot from this forum.
I have server with RAM 64 GB with MySQL Version 5.1.63-cll x86_64. I need help how to optimize my.cnf
Here is my.cnf
I am new member in this forum. I hope I can learn a lot from this forum.
I have server with RAM 64 GB with MySQL Version 5.1.63-cll x86_64. I need help how to optimize my.cnf
Here is my.cnf
Here is output mysql tuner :[mysqld]
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
#skip-innodb
query_cache_limit=128M
query_cache_size=32K
join_buffer_size=2M
tmp_table_size=64M
max_heap_table_size=64M
query_cache_type=1K
max_user_connections=50
max_connections=50
interactive_timeout=10
wait_timeout=10
connect_timeout=10
thread_cache_size=16M
key_buffer=1024M
join_buffer=128M
max_allowed_packet=16M
table_cache=800000
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
thread_concurrency=8
myisam_sort_buffer_size=64M
server-id=1
key_buffer_size=2048M
table_definition_cache=100000
innodb_buffer_pool_size=20M
log-slow-queries = /var/lib/mysql/mysql-slow.log
long_query_time = 1
#[mysql.server]
#user=mysql
#basedir=/var/lib
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=300000
#[mysqldump]
#quick
#max_allowed_packet=16M
[mysql]
no-auto-rehash
[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
[mysqlhotcopy]
interactive-timeout
Here is output from tuning primer :[email protected] [~]# ./mysqlmymonlite.sh mysqltuner
-------------------------------------------------------------
System MySQL monitoring stats
mysqlmymonlite.sh - 0.4.0 mysqlmymon.com
compiled by George Liu (eva2000) vbtechsupport.com
-------------------------------------------------------------
Report Generated:
Sat Jul 7 22:40:49 PDT 2012
-------------------------------------------------
mysqltuner output
-------------------------------------------------
mysqltuner.pl [found]
>> MySQLTuner 1.2.0 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[OK] Logged in using credentials passed on the command line
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.63-cll
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 1017M (Tables: 2949)
[--] Data in InnoDB tables: 10M (Tables: 57)
[!!] Total fragmented tables: 144
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 34m 50s (325K q [155.929 qps], 4K conn, TX: 1B, RX: 54M)
[--] Reads / Writes: 97% / 3%
[--] Total buffers: 2.1G global + 132.5M per thread (50 max threads)
[OK] Maximum possible memory usage: 8.6G (13% of installed RAM)
[OK] Slow queries: 0% (1/325K)
[OK] Highest usage of available connections: 30% (15/50)
[OK] Key buffer size / total MyISAM indexes: 2.0G/391.2M
[OK] Key buffer hit rate: 99.9% (54M cached / 42K reads)
[!!] Query cache efficiency: 0.0% (0 cached / 300K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (881 temp sorts / 90K sorts)
[!!] Joins performed without indexes: 199
[!!] Temporary tables created on disk: 48% (72K on disk / 148K total)
[OK] Thread cache hit rate: 99% (15 created / 4K connections)
[OK] Table cache hit rate: 96% (1K open / 1K opened)
[OK] Open file limit used: 0% (1K/300K)
[OK] Table locks acquired immediately: 99% (454K immediate / 454K locks)
[OK] InnoDB data size / buffer pool: 10.3M/20.0M
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
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:
query_cache_limit (> 128M, or use smaller result sets)
join_buffer_size (> 128.0M, or always use indexes with joins)
tmp_table_size (> 64M)
max_heap_table_size (> 64M)
Report Complete:
Sat Jul 7 22:40:50 PDT 2012
Thanks[email protected] [~]# ./tuning-primer.sh
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 5.1.63-cll x86_64
Uptime = 0 days 0 hrs 35 min 54 sec
Avg. qps = 154
Total Questions = 332768
Threads Connected = 9
Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations
To find out more information on how each of these
runtime variables effects performance visit:
MySQL :: MySQL 5.1 Reference Manual :: 5.1.3 Server System Variables
Visit MySQL :: MySQL Enterprise Advisors
for info about MySQL's Enterprise Monitoring and Advisory Service
SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 1.000000 sec.
You have 2 out of 332795 that take longer than 1.000000 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 MySQL :: MySQL 5.1 Reference Manual :: 7.5 Point-in-Time (Incremental) Recovery Using the Binary Log
WORKER THREADS
Current thread_cache_size = 16384
Current threads_cached = 8
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 = 11
Historic max_used_connections = 15
The number of used connections is 30% of the configured maximum.
Your max_connections variable seems to be fine.
INNODB STATUS
Current InnoDB index space = 1 M
Current InnoDB data space = 10 M
Current InnoDB buffer pool free = 46 %
Current innodb_buffer_pool_size = 20 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory
MEMORY USAGE
Max Memory Ever Allocated : 3.96 G
Configured Max Per-thread Buffers : 6.46 G
Configured Max Global Buffers : 2.02 G
Configured Max Memory Limit : 8.49 G
Physical Memory : 62.75 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 391 M
Current key_buffer_size = 2.00 G
Key cache miss rate is 1 : 1315
Key buffer free ratio = 79 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is enabled
Current query_cache_size = 32 K
Current query_cache_used = 32 K
Current query_cache_limit = 128 M
Current Query cache Memory fill ratio = 100.00 %
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 = 128.00 M
You have had 205 queries where a join could not use an index properly
join_buffer_size >= 4 M
This is not advised
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
OPEN FILES LIMIT
Current open_files_limit = 300000 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_open_cache = 524288 tables
Current table_definition_cache = 100000 tables
You have a total of 3029 tables
You have 3148 open tables.
The table_cache value seems to be fine
TEMP TABLES
Current max_heap_table_size = 64 M
Current tmp_table_size = 64 M
Of 77112 temp tables, 48% 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 = 2 M
Current table scan ratio = 17 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 27234
Your table locking seems to be fine