MySQL Version 5.0.92-community i686
Uptime = 17 days 21 hrs 2 min 25 sec
Avg. qps = 108
Total Questions = 167919045
Threads Connected = 3
Server has been running for over 48hrs.
It should be safe to follow these recommendations
To find out more information on how each of these
runtime variables effects performance visit:
for info about MySQL's Enterprise Monitoring and Advisory Service
The slow query log is NOT enabled.
Current long_query_time = 10 sec.
You have 4775 out of 167919071 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
Current thread_cache_size = 0
Current threads_cached = 0
Current threads_per_sec = 6
Historic threads_per_sec = 3
Threads created per/sec are overrunning threads cached
You should raise thread_cache_size
Current max_connections = 500
Current threads_connected = 6
Historic max_used_connections = 115
The number of used connections is 23% of the configured maximum.
Your max_connections variable seems to be fine.
Current InnoDB index space = 5 M
Current InnoDB data space = 4 M
Current InnoDB buffer pool free = 22 %
Current innodb_buffer_pool_size = 8 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
Max Memory Ever Allocated : 327 M
Configured Max Per-thread Buffers : 1.31 G
Configured Max Global Buffers : 17 M
Configured Max Memory Limit : 1.32 G
Physical Memory : 3.95 G
Max memory limit seem to be within acceptable norms
Current MyISAM index space = 2.82 G
Current key_buffer_size = 7 M
Key cache miss rate is 1 : 31
Key buffer free ratio = 76 %
Your key_buffer_size seems to be fine
Query cache is supported but not enabled
Perhaps you should set the query_cache_size
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine
Current join_buffer_size = 132.00 K
You have had 499755 queries where a join could not use an index properly
You have had 342 joins without keys that check for key usage after each row
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 = 2500 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
Current table_cache value = 64 tables
You have a total of 17617 tables
You have 64 open tables.
Current table_cache hit rate is 0%
, while 100% of your table cache is in use
You should probably increase your table_cache
Current max_heap_table_size = 16 M
Current tmp_table_size = 32 M
Of 11203514 temp tables, 13% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine
Current read_buffer_size = 128 K
Current table scan ratio = 15 : 1
read_buffer_size seems to be fine
Current Lock Wait ratio = 1 : 372
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'.
[email protected] [~]# ./mysqltuner.pl
>> 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
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.92-community
[!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB +Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 7G (Tables: 17363)
[--] Data in InnoDB tables: 4M (Tables: 42)
[--] Data in MEMORY tables: 20M (Tables: 195)
[!!] Total fragmented tables: 1505
-------- Security Recommendations -------------------------------------------
[!!] User [email protected]' has no password set.
-------- Performance Metrics -------------------------------------------------
[--] Up for: 17d 21h 12m 25s (168M q [108.742 qps], 5M conn, TX: 3B, RX: 602M)
[--] Reads / Writes: 92% / 8%
[--] Total buffers: 34.0M global + 2.7M per thread (500 max threads)
[OK] Maximum possible memory usage: 1.3G (33% of installed RAM)
[OK] Slow queries: 0% (4K/168M)
[OK] Highest usage of available connections: 23% (115/500)
[OK] Key buffer size / total MyISAM indexes: 8.0M/2.8G
[OK] Key buffer hit rate: 96.8% (34B cached / 1B reads)
[!!] Query cache is disabled
[!!] Sorts requiring temporary tables: 11% (3M temp sorts / 27M sorts)
[!!] Joins performed without indexes: 500380
[OK] Temporary tables created on disk: 13% (1M on disk / 12M total)
[!!] Thread cache is disabled
[!!] Table cache hit rate: 0% (64 open / 62M opened)
[OK] Open file limit used: 4% (112/2K)
[OK] Table locks acquired immediately: 99% (214M immediate / 214M locks)
[OK] InnoDB data size / buffer pool: 4.6M/8.0M
-------- 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
Set thread_cache_size to 4 as a starting value
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
query_cache_size (>= 8M)
sort_buffer_size (> 1M)
read_rnd_buffer_size (> 256K)
join_buffer_size (> 128.0K, or always use indexes with joins)
thread_cache_size (start at 4)
table_cache (> 64)
[email protected] [~]# pico -w /etc/my.cnf
You cannot use other peoples configuration files, every database is different.
Please enable your slow query log and set the long_query_time to 1.
Allow time for the slow log query to generate and use mysqlsla to analyze the log file.
You will not get an optimized MySQL server without doing your homework or asking for configuration settings, most problems are with queries thus tuning my.cnf in most cases doesn't prove to be a performance boost of any magnitude.
If you use mysqlreport and your MyISAM or INNODB buffer pools are 100% utilized then adjust those.
neither I am mysql expert but
- definitively enable the query cache, increase the memory for the cache until not fully used, say until 80 percent usage
- similarly increase gradually the memory for buffers, especiall key buffer and InnoDB Buffer Pool , but be extremely carefull when changing buffers allocated per thread eg. join buffer size etc. - if you set it 2M and got 500 threads running each with 2 joins, this is 2G memory for this buffer only!
- use table chache effectively - increase the open file limit for mysql user to eg. 5000 than set the number of cached tables to 1000, later to 1500
- in short do small changes in week intervals, use automatically generated mysql reports, evaluate effects and do additional changes