Jul 24

MySQL Server must run a few days or weeks, or it wont be be safe to follow these recommendations.

Downlaod it:

wget http://www.day32.com/MySQL/tuning-primer.sh

grant privilege:

chmod +x tuning-primer.sh

Execute script:

sh tuning-primer.sh

 

Here is an example of  tuning-primer.sh output:

        — MYSQL PERFORMANCE TUNING PRIMER —
             – By: Matthew Montgomery –

MySQL Version 4.1.22-standard-log i686

Uptime = 10 days 22 hrs 39 min 49 sec
Avg. qps = 0
Total Questions = 571959
Threads Connected = 1

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:

http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL’s Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 5 sec.
You have 0 out of 571973 that take longer than 5 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 http://dev.mysql.com/doc/refman/4.1/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 128
Current threads_cached = 14
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 1024
Current threads_connected = 1
Historic max_used_connections = 15
The number of used connections is 1% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating

MEMORY USAGE
Max Memory Ever Allocated : 245 M
Configured Max Per-thread Buffers : 7.17 G
Configured Max Global Buffers : 138 M
Configured Max Memory Limit : 7.31 G
Physical Memory : 1.97 G

Max memory limit exceeds 90% of physical memory

KEY BUFFER
Current MyISAM index space = 259 M
Current key_buffer_size = 64 M
Key cache miss rate is 1 : 188
Key buffer free ratio = 85 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 64 M
Current query_cache_used = 27 M
Current query_cache_limit = 2 M
Current Query cache Memory fill ratio = 42.39 %
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 = 1 M
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 1.00 M
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

OPEN FILES LIMIT
Current open_files_limit = 5120 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_cache value = 256 tables
You have a total of 642 tables
You have 168 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 32 M
Of 18233 temp tables, 46% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
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 = 1 M
Current table scan ratio = 22 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 39461
Your table locking seems to be fine

Tagged with:
preload preload preload