Selam iyinet bunuda verirsen cok sevinirim..
Kod:
Mysql çok kullanılıyor load yogun oldugu zamanlarda 10 ve üstüne cıkabılıyor.
Makina özellikleri
AMD Opteron 1212 (Dual Core)
3 GB DDR2-Ram
Cpanel / WHM
..
Alıntı:
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 4.1.22-standard i686
Uptime = 4 days 21 hrs 3 min 20 sec
Avg. qps = 70
Total Questions = 29673577
Threads Connected = 4
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/...variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service
SLOW QUERIES
Current long_query_time = 10 sec.
You have 9393 out of 29673596 that take longer than 10 sec. to complete
The slow query log is NOT enabled.
Your long_query_time may be too high, I typically set this under 5 sec.
WORKER THREADS
Current thread_cache_size = 8
Current threads_cached = 4
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 500
Current threads_connected = 5
Historic max_used_connections = 323
The number of used connections is 64% of the configured maximum.
Your max_connections variable seems to be fine.
MEMORY USAGE
Max Memory Ever Allocated : 4 G
Configured Max Per-thread Buffers : 6 G
Configured Max Global Buffers : 426 M
Configured Max Memory Limit : 6 G
Physical Memory : 2.90 G
Max memory limit exceeds 90% of physical memory
KEY BUFFER
Current MyISAM index space = 1 G
Current key_buffer_size = 384 M
Key cache miss rate is 1 : 2057
Key buffer fill ratio = 98.00 %
You could increase key_buffer_size
It is safe to raise this up to 1/4 of total system memory;
assuming this is a dedicated database server.
QUERY CACHE
Query cache is enabled
Current query_cache_size = 32 M
Current query_cache_used = 31 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 97.29 %
Current query_cache_min_res_unit = 4 K
Query Cache is 9 % fragmented
Run "FLUSH QUERY CACHE" periodically to defragment the query cache memory
If you have many small queries lower 'query_cache_min_res_unit' to reduce fragmentation.
However, 4325075 queries have been removed from the query cache due to lack of memory
Perhaps you should raise query_cache_size
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 = 7 M
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 132.00 K
You have had 14631 queries where a join could not use an index properly
You have had 55 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 = 17510 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
You currently have open more than 75% of your open_files_limit
You should set a higher value for open_files_limit in my.cnf
TABLE CACHE
Current table_cache value = 8500 tables
You have a total of 9030 tables
You have 8382 open tables.
Current table_cache hit rate is 13%, while 98% of your table cache is in use
You should probably increase your table_cache
TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 40 M
Of 1134378 temp tables, 4% 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 = 1 M
Current table scan ratio = 292 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 562
You may benefit from selective use of InnoDB.
|
my.cnf Dosyası içeriği ;
Kod:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-innodb
skip-locking
local-infile=0
safe-show-database
max_connections = 500
max_user_connections = 400
key_buffer = 384M
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
table_cache = 8500
tmp_table_size = 40M
low_priority_updates = 1
max_allowed_packet = 8M
thread_cache_size = 8
query_cache_size = 32M
query_cache_type = 1