Arkiv

Inlägg taggade ‘databas’

Optimera MySQL med mysqlcheck

november 8th, 2011 Inga kommentarer

För att kolla och reparera samt optimera alla mysql databaser så kör detta kommando :

mysqlcheck -u root -p –auto-repair –check –optimize –all-databases

Man kan sedan använda denna i cron för att få denna optimering dagligen.

Relaterade länkar om Optimera MySQL med mysqlcheck

Sökningar:

Optimera MySQL

oktober 22nd, 2011 Inga kommentarer

Tänkte tipsa om ännu ett verktyg för att optimera mysql och hålla ordning på allt, och det är tuning-primer.sh

Du kan ladda hem scriptet här:

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

Här nedan kan du se ett exempel på resultatet från tuning-primer.sh:

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

MySQL Version 5.0.51a-24+lenny2-log i486

Uptime = 0 days 0 hrs 0 min 14 sec
Avg. qps = 73
Total Questions = 1028
Threads Connected = 2

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:

http://dev.mysql.com/doc/refman/5.0/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 = 2 sec.
You have 0 out of 1124 that take longer than 2 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/5.0/en/point-in-time-recovery.html

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

MAX CONNECTIONS
Current max_connections = 125
Current threads_connected = 1
Historic max_used_connections = 2
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

No InnoDB Support Enabled!

MEMORY USAGE
Max Memory Ever Allocated : 71 M
Configured Max Per-thread Buffers : 328 M
Configured Max Global Buffers : 66 M
Configured Max Memory Limit : 394 M
Physical Memory : 1011 M
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 14 M
Current key_buffer_size = 16 M
Key cache miss rate is 1 : 13
Key buffer free ratio = 87 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 40 M
Current query_cache_used = 388 K
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = .94 %
Current query_cache_min_res_unit = 4 K
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
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 = 132.00 K
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 = 4247 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 = 2056 tables
You have a total of 673 tables
You have 673 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 208 temp tables, 16% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 7 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 0 : 2056
Your table locking seems to be fine

Categories: GSOC Taggar: , , , , , , ,