Wykorzystanie ~40%CPU przez Mysql
Wykorzystanie ~40%CPU przez Mysql
#1
Napisany 04 marzec 2009 - 20:45
#2
Napisany 04 marzec 2009 - 20:45
#3
Napisany 04 marzec 2009 - 20:51
p, o 4.03.2009, 20:45, powiedział:
Ok
To tak:
System CentOS, Apache 2, PHP 5, MySQL 5, panel Plesk, forum stoi na skrypcie vBulletin do tego vBSEO oraz kilka modów, które zapisują dane do bazy(mody mało obciążają, praktycznie w ogóle). Przy obciążeniu proca 100%, obciążenie RAM: 42%.
Nie wiem co jeszcze mogę podać
#4
Napisany 04 marzec 2009 - 20:53
#5
Napisany 04 marzec 2009 - 20:56
Cytuj
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
max_allowed_packet=1G
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
#6 Gość_N3T5kY_*
Napisany 04 marzec 2009 - 21:04
Odpal sobie :
Cytuj
MySQL powinien działać od 48h
#7
Napisany 04 marzec 2009 - 21:11
-- MYSQL PERFORMANCE TUNING PRIMER -- - By: Matthew Montgomery - MySQL Version 5.0.45 i686 Uptime = 25 days 22 hrs 13 min 18 sec Avg. qps = 16 Total Questions = 36939290 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/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 NOT enabled. Current long_query_time = 10 sec. You have 9 out of 36939322 that take longer than 10 sec. to complete Your long_query_time may be too high, I typically set this under 5 sec. 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 = 0 Current threads_cached = 0 Current threads_per_sec = 6 Historic threads_per_sec = 1 Threads created per/sec are overrunning threads cached You should raise thread_cache_size MAX CONNECTIONS Current max_connections = 100 Current threads_connected = 2 Historic max_used_connections = 66 The number of used connections is 66% of the configured maximum. Your max_connections variable seems to be fine. MEMORY USAGE Max Memory Ever Allocated : 195 M Configured Max Per-thread Buffers : 268 M Configured Max Global Buffers : 17 M Configured Max Memory Limit : 286 M Physical Memory : 1.95 G Max memory limit seem to be within acceptable norms KEY BUFFER Current MyISAM index space = 128 M Current key_buffer_size = 7 M Key cache miss rate is 1 : 233 Key buffer fill ratio = 55.00 % Your key_buffer_size seems to be fine QUERY CACHE Query cache is supported but not enabled Perhaps you should set the query_cache_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 42891 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 = 1024 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 = 64 tables You have a total of 1423 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 TEMP TABLES Current max_heap_table_size = 16 M Current tmp_table_size = 32 M Of 2906531 temp tables, 2% 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 = 70 : 1 read_buffer_size seems to be fine TABLE LOCKING Current Lock Wait ratio = 1 : 6066 Your table locking seems to be fine
#8 Gość_N3T5kY_*
Napisany 04 marzec 2009 - 21:20
Cytuj
query_cache_size = 32M
table_cache = 512
restart mysqla
Cytuj
I poczekaj na efekty
#9
Napisany 04 marzec 2009 - 21:23
#10
Napisany 04 marzec 2009 - 21:24
tak wrzuć te wartości, jeśli one już istnieją to po prostu zmień ich wartości na takie jak kolega wyżej zaproponował;-)
Pozdrawiam
#11
Napisany 04 marzec 2009 - 21:33
Current table_cache value = 64 tables
to to samo co:
table_cache = 512
??
#12
Napisany 04 marzec 2009 - 21:54
#13
Napisany 04 marzec 2009 - 22:56
[mysqld] set-variable=local-infile=0 datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 max_allowed_packet=1G [mysql.server] user=mysql basedir=/var/lib [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid long_query_time = 5 query_cache_size = 32M table_cache = 512
#14
Napisany 04 marzec 2009 - 22:57
/etc/init.d/mysql restart
i zobacz czy będzie lepiej;]
#15
Napisany 04 marzec 2009 - 23:05
crazyluki, o 4.03.2009, 22:57, powiedział:
/etc/init.d/mysql restart
i zobacz czy będzie lepiej;]
Tak zrobiłem, w moim przypadku restart leci po przez:
/etc/init.d/mysqld restart
Mam jeszcze jedno pytanie czy jest jakaś komenda, która wywali mi w konsoli ustawienia mysql, chodzi mi o to czy na pewno zmiany się zapisały
#16
Napisany 04 marzec 2009 - 23:08
#17
Napisany 04 marzec 2009 - 23:14
#18
Napisany 05 marzec 2009 - 10:50
mysql -u root -p
i wpisz:
show variables;
Tani hosting SEO i serwery www - www.hoseo.pl
A??e?a?or ?ew??w - już wkrótce - www.grzebacz.pl i www.grzebacz.it
#19
#20
Napisany 05 marzec 2009 - 15:51
1 Użytkowników czyta ten temat
0 użytkowników, 1 gości, 0 anonimowych użytkowników










