Benutzer-Werkzeuge

Webseiten-Werkzeuge


Seitenleiste

Navigation

Mein Blog magenbrot.net



Mail-, Web-, Domainhosting und vieles mehr durch OVTEC Völker IT.

datenbanken:mysql:performance_tuning_check-script

MySQL Performance Tuning Check-Script

wget -O /usr/local/sbin/tuning-primer.sh http://www.day32.com/MySQL/tuning-primer.sh
chmod 755 /usr/local/sbin/tuning-primer.sh
/usr/local/sbin/tuning-primer.sh

Das Script versucht nun Zugangsdaten zur Datenbank zu finden (sucht unter anderem nach Webmin, etc). Sofern keine gefunden wurden, wird der User um die Eingabe der Daten gebeten. Das Script bietet auch an, die Zugangsdaten in ~/.my.cnf zu speichern. Dies könnte eine Sicherheitslücke darstellen, daher würde ich das ablehnen. Nun legt das Script los und bietet nach dem Durchlauf eine Übersicht optimierbarer Einstellungen an:

[root@magenbrot sbin]# ./tuning-primer.sh 

- INITIAL LOGIN ATTEMPT FAILED -

Testing Stored for passwords: None Found

- RETRY LOGIN ATTEMPT FAILED -

Could not auto detect login info!

Do you have your login handy ? [y/N] : y
User: root
Password: 
Would you like me to create a ~/.my.cnf file for you? [y/N] : n

        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.0.27 i686

Uptime = 2 days 19 hrs 19 min 46 sec
Avg. qps = 0
Total Questions = 216752
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/5.0/en/server-system-variables.html

SLOW QUERIES
Current long_query_time = 2 sec.
You have 1 out of 216764 that take longer than 2 sec. to complete
The slow query log is NOT enabled.
Your long_query_time seems to be fine

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

MAX CONNECTIONS
Current max_connections = 50
Current threads_connected = 1
Historic max_used_connections = 26
The number of used connections is 52% of the configured maximum.
Your max_connections variable seems to be fine.

MEMORY USAGE
Max Memory Ever Allocated : 82 M
Configured Max Per-thread Buffers : 134 M
Configured Max Global Buffers : 13 M
Configured Max Memory Limit : 147 M
Total System Memory : 3.97 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 739 K
Current key_buffer_size = 2 M
Key cache miss rate is 1 : 119
Key buffer fill ratio = 16.00 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere

QUERY CACHE
Query cache is enabled
Current query_cache_size = 1 M
Current query_cache_used = 465 K
Current query_cach_limit = 1 M
Current Query cache fill ratio = 45.45 %
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current record/read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 29 queries where a join could not use an index properly
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 = 2048 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 = 512 tables
You have a total of 240 tables
You have 494 open tables.
Current table_cache hit rate is 13%, while 96% of your table cache is in use
You should probably increase your table_cache

TEMP TABLES
Current max_heap_table_size = 31 M
Current tmp_table_size = 64 M
Of 3060 temp tables, 49% 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 = 128 K
Current table scan ratio = 63 : 1
read_buffer_size seems to be fine

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

Diskussion

Geben Sie Ihren Kommentar ein. Wiki-Syntax ist zugelassen:
C G A M V
 
datenbanken/mysql/performance_tuning_check-script.txt · Zuletzt geändert: 16.04.2015 13:05 (Externe Bearbeitung)