![]() |
|
|||||||
| MySQL Veritabanı SQL SQL MySQL Access MSSQL Oracle Veritabani Database |
![]() |
|
|
LinkBack (10) | Seçenekler | Stil |
|
||||
|
Yukarıya yazdığım son raporu almadan 1 gün önce test amaçlı mysql-indexleri yapılmış olan sitelerin mysql-indexlerini kaldırmıştım, az önce mysql-indexlerini tekrar eski haline düzenledim ve aşağıdaki değerleri düzenledim.
key_buffer=64M #eskideğer-32M query_cache_size=64M #eskideğer-32M Innodb özelliğini sadece Plesk panel kullanıyor, myisam kullanıyorum. Sunucuda toplam 5 adet, boyutları 1-50mb / 500-90.000 satır arası 5 veritabanı var, gizli değil şahsi sitelerim php+mysql ve sistem kaynaklarını mümkün olduğunca az kullanan scriptler. Forum/portal gibi ağır scriptler yok ve sitelerde file-caching yöntemi ile sql konusunda işlemciye yardımcı oluyorum fakat sunucunun işlemcisi yetmiyor. Online kişilerin yoğun olduğu zamanlarda genelde arama(like) sql sorguları yüzünden CPU %90 lara kadar çıkıyor ![]() Konu bilmiyorum tarafından (2008-03-26 Saat 03:00 ) değiştirilmiştir.. |
|
||||
|
tuning-primer.sh çıktısı :
Kod:
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 4.1.22-standard i686
Uptime = 3 days 17 hrs 10 min 19 sec
Avg. qps = 51
Total Questions = 16455832
Threads Connected = 71
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
Current long_query_time = 5 sec.
You have 5870 out of 16455844 that take longer than 5 sec. to complete
The slow query log is NOT enabled.
Your long_query_time seems to be fine
WORKER THREADS
Current thread_cache_size = 8
Current threads_cached = 7
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 = 71
Historic max_used_connections = 228
The number of used connections is 45% of the configured maximum.
Your max_connections variable seems to be fine.
MEMORY USAGE
Max Memory Ever Allocated : 662 M
Configured Max Per-thread Buffers : 1 G
Configured Max Global Buffers : 49 M
Configured Max Memory Limit : 1 G
Physical Memory : 2.97 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 333 M
Current key_buffer_size = 7 M
Key cache miss rate is 1 : 166
Key buffer fill ratio = 100.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 = 22 M
Current query_cache_limit = 4 M
Current Query cache Memory fill ratio = 70.09 %
Current query_cache_min_res_unit = 4 K
Query Cache is 15 % 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.
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 400 queries where a join could not use an index properly
You have had 3 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 = 4510 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 = 2000 tables
You have a total of 1090 tables
You have 1935 open tables.
Current table_cache hit rate is 52%, while 96% 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 386548 temp tables, 6% 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 = 804 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 283
You may benefit from selective use of InnoDB.
şuanki mysql.cnf : Kod:
[mysqld] set-variable = max_connections=500 safe-show-database skip-locking skip-name-resolve long_query_time = 5 thread_cache_size = 8 query_cache_type = 1 query_cache_size = 32M query_cache_limit = 4M table_cache = 2000 low_priority_updates = 1 |
|
||||
|
Alıntı:
top çıktısı : Kod:
[root@host ~]# top top - 19:19:04 up 2:54, 1 user, load average: 1.03, 1.00, 1.03 Tasks: 268 total, 3 running, 265 sleeping, 0 stopped, 0 zombie Cpu(s): 16.7% us, 1.3% sy, 0.0% ni, 81.6% id, 0.2% wa, 0.0% hi, 0.1% si Mem: 3116652k total, 2707528k used, 409124k free, 58992k buffers Swap: 2000968k total, 0k used, 2000968k free, 708196k cached PID USER PR NI %CPU TIME+ %MEM VIRT RES SHR S COMMAND 4543 mysql 20 0 3 28:13.79 2.9 161m 87m 3596 S mysqld 4987 nobody 20 0 0 0:48.84 1.1 42808 32m 3156 S httpd 4990 nobody 20 0 0 1:17.80 1.0 39696 29m 3312 S httpd 4945 nobody 20 0 2 1:10.89 0.9 37752 27m 3344 S httpd 4983 nobody 20 0 0 1:05.10 0.9 37508 27m 3432 S httpd 4972 nobody 20 0 5 1:03.16 0.9 37716 27m 3148 S httpd 4958 nobody 20 0 0 1:07.71 0.9 37632 27m 3336 S httpd 4994 nobody 20 0 0 0:51.48 0.9 37508 27m 3180 S httpd 4984 nobody 20 0 0 1:34.48 0.9 37284 27m 3308 S httpd 4948 nobody 20 0 0 1:12.47 0.9 37136 27m 3424 S httpd 6127 nobody 20 0 0 0:47.61 0.9 37132 27m 3232 S httpd 5011 nobody 20 0 0 1:18.24 0.9 36892 27m 3312 S httpd 4989 nobody 20 0 0 0:55.59 0.9 37052 27m 3136 S httpd 5008 nobody 20 0 0 1:09.12 0.9 37004 27m 3340 S httpd 4997 nobody 20 0 0 1:08.36 0.9 36648 26m 3312 S httpd 4933 nobody 20 0 0 1:05.80 0.9 36756 26m 3144 S httpd 4961 nobody 20 0 0 1:05.66 0.9 36784 26m 3296 S httpd 6128 nobody 20 0 0 1:12.28 0.9 36668 26m 3208 S httpd 9728 nobody 20 0 0 0:30.39 0.9 36576 26m 3272 S httpd 5002 nobody 20 0 0 1:12.45 0.9 36708 26m 3152 S httpd 4943 nobody 20 0 0 1:15.11 0.9 36500 26m 3216 S httpd 4995 nobody 20 0 0 1:01.13 0.9 36528 26m 3176 S httpd 4964 nobody 20 0 0 1:02.08 0.9 36508 26m 3160 S httpd 4790 nobody 20 0 0 1:05.30 0.9 35996 26m 3220 S httpd 4988 nobody 20 0 0 1:01.13 0.8 35380 25m 3220 S httpd 7273 nobody 20 0 0 0:48.22 0.8 35308 25m 3272 S httpd 4996 nobody 20 0 0 1:04.31 0.8 35260 25m 3292 S httpd 4789 nobody 20 0 0 0:57.84 0.8 35120 25m 3144 S httpd 4734 root 20 0 0 0:01.15 0.8 27524 24m 1956 S spamd 5141 root 20 0 0 0:01.15 0.8 27784 24m 1468 S spamd 5006 nobody 20 0 0 1:17.35 0.8 34352 24m 3312 S httpd |
|
||||
|
Alıntı:
4Gb RAM var demissin ama 3Gb ram gorunuyor. |
|
||||
|
şuan ram kullanımı %15 olmasına rağmen swap da kullanılıyor
top - 11:51:36 up 19:26, 1 user, load average: 0.22, 0.55, 1.17 Tasks: 163 total, 2 running, 161 sleeping, 0 stopped, 0 zombie Cpu(s): 36.8% us, 3.1% sy, 0.0% ni, 58.4% id, 1.6% wa, 0.0% hi, 0.1% si Mem: 3116652k total, 2826164k used, 290488k free, 11684k buffers Swap: 2000968k total, 161376k used, 1839592k free, 2314784k cached PID USER PR NI %CPU TIME+ %MEM VIRT RES SHR S COMMAND 4543 mysql 20 0 20 98:48.68 2.1 153m 63m 2872 S mysqld 5141 root 20 0 0 0:07.69 0.6 27784 17m 1368 S spamd 1162 nobody 20 0 0 0:06.89 0.6 27488 17m 3124 S httpd 1144 nobody 20 0 0 0:05.10 0.6 27228 17m 3140 S httpd 1149 nobody 20 0 0 0:08.18 0.6 26612 16m 3128 S httpd 1142 nobody 20 0 2 0:10.46 0.5 26676 16m 3128 S httpd 1147 nobody 20 0 0 0:05.73 0.5 26604 16m 3204 S httpd 1148 nobody 20 0 0 0:07.84 0.5 26432 16m 3324 S httpd 1157 nobody 20 0 4 0:07.17 0.5 26352 16m 3188 S httpd 1158 nobody 20 0 18 0:07.29 0.5 26400 16m 3216 S httpd 1153 nobody 20 0 5 0:04.82 0.5 26164 16m 3280 S httpd 1138 nobody 20 0 0 0:07.22 0.5 26172 16m 3136 S httpd 1146 nobody 20 0 0 0:03.99 0.5 26156 16m 3204 S httpd 1139 nobody 20 0 0 0:04.62 0.5 26040 16m 3200 S httpd 1150 nobody 20 0 0 0:05.46 0.5 26124 16m 3208 S httpd 1145 nobody 20 0 2 0:06.69 0.5 26012 16m 3144 S httpd 1370 nobody 20 0 5 0:05.24 0.5 25980 16m 3200 S httpd 1143 nobody 20 0 24 0:07.49 0.5 25764 16m 3300 S httpd 1316 nobody 20 0 0 0:02.45 0.5 25772 15m 3176 S httpd 1152 nobody 20 0 0 0:08.01 0.5 25780 15m 3200 S httpd 1155 nobody 20 0 0 0:04.97 0.5 25736 15m 3216 S httpd 1137 nobody 20 0 0 0:07.16 0.5 25632 15m 3292 S httpd 1136 nobody 20 0 0 0:09.38 0.5 25728 15m 3208 S httpd 1154 nobody 20 0 0 0:06.49 0.5 25604 15m 3160 S httpd 1141 nobody 20 0 0 0:03.20 0.5 25764 15m 2944 S httpd 1140 nobody 20 0 0 0:12.32 0.5 24948 15m 3132 S httpd 1161 nobody 20 0 0 0:07.69 0.5 24644 14m 3204 S httpd 1369 nobody 20 0 0 0:04.88 0.5 24388 14m 3064 S httpd 1307 nobody 20 0 0 0:04.91 0.5 24128 14m 3168 S httpd 1135 nobody 20 0 4 0:04.98 0.5 23756 14m 3296 S httpd 1151 nobody 20 0 3 0:04.05 0.5 23728 13m 3132 S httpd |
|
||||
|
Alıntı:
iyinet: tavsiyelerinden 2 gün sonra aldığım rapora göre sonuçlar aşağıda. Anladığım kadarıyla, key_buffer değerini azaltıp, zend'i kaldırıp xcache veya eaccelerator kurmak harici yapılacak birşey kalmıyor değil mi ? Alıntı:
Alıntı:
|
|
||||
|
Alıntı:
Xcache i php 5.1 in ustunu kullaniyorsan kur, aksi taktirde eaccelerator kur. Zend i kaldirip kaldirmamak sana kalmis, kullanmiyorsan kaldir. Xcache yada eaccelerator u kurunca php.ini icinde onlarin satirlarini Zend den once koymayi unutma! Innodb parametrelerini de eklmeyi unutma onlarda onemli. key_buffer ve query_cache degerlerini performans raporu ile arada bir kontrol ederek ayarla. MySQL optimizasyonu 1 seferlik bir degil, 3-5 ayda bir elden gecirmekte fayda var. |
![]() |
LinkBacks (?)
LinkBack to this Thread: http://forum.iyinet.com/mysql-veritabani-sql/77047-tuning-primer-sh-mysql-tuning-scripti-mysql-performans-raporu.html
|
||||
| Konuyu Başlatan | For | Type | Tarih | |
| iyinet webmaster forumu 2008 seo yarışması 2008 Mayıs | This thread | Refback | 2008-07-12 04:39 | |
| iyinet webmaster forumu 2008 seo yarışması - iyinet webmaster forumu 2008 seo yarışması Mysql Performans Testi | This thread | Pingback | 2008-05-27 19:14 | |
| Turkwm.com: 5 dakikada hızlı mysql server optimizasyonu | This thread | Refback | 2008-05-15 16:20 | |
| Turkwm.com | This thread | Refback | 2008-05-15 13:42 | |
| 2007 Aralk -Webmaster Kaynak Sitesi | This thread | Refback | 2008-01-15 06:13 | |
| tuning-primer.sh mysql tuning scripti - Google - Webmaster Forum / Google Webmaster Fan | This thread | Refback | 2008-01-11 19:23 | |
| Mysql Tuning Scripti tuning-primer.sh | Webmaster Blogu | This thread | Pingback | 2007-12-23 21:44 | |
| Load sorunu yaşayanlar için genel tartışma konusu - vBulletin SEO Forums | This thread | Refback | 2007-12-12 10:58 | |
| Linux & Unix -Webmaster Kaynak Sitesi | This thread | Refback | 2007-12-11 08:55 | |
| mysql optimizastonu iin tuning-primer.sh scripti -Webmaster Kaynak Sitesi | This thread | Pingback | 2007-12-06 19:03 | |
| Seçenekler | |
| Stil | |
|
|
Benzer Konular
|
||||
| Konu | Konuyu Başlatan | Forum | Cevaplar | Son Mesaj |
| Tuning Merkezi | trebuchet55 | Yeni Site Tanıtımları | 0 | 2008-02-24 15:21 |
| Sanal Tuning | Alexis | Yeni Site Tanıtımları | 6 | 2008-01-18 04:07 |
| sadece tuning, sanal tuning siteleri ile - PR4 | Alexis | Google PR Link Değişimi | 0 | 2007-05-11 00:50 |
| Tuning Siteleri . Com | sverdlow | Yeni Site Tanıtımları | 2 | 2006-11-19 11:00 |
| Mysql Asp Performans Sorusu | disconnect | MySQL Veritabanı SQL | 6 | 2006-10-04 22:16 |