İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

MySQL CPU Kullanımı my.cnf optimizasyonu

3L3cTRic

0
İyinet Üyesi
Katılım
25 Ocak 2005
Mesajlar
0
Reaction score
0
Kanatlarını bağla diycem ama...

Bir veritabanının uçmasını 2 şekilde anlıyorum,
1. süper hızlı
2. veritabanı kayıp yani silinmiş

senin uçuş hangi türden?


Ya hocam :) gerçekten güldüm. Neyse uçma tabirim Mysql in sürekli kapanması yani kendi kendine kapanıyor. (uçma) tabiri oydu. Mytop bile kurdum ama pek fazla bişeyde göremedim açıkcası apache statuste kurdum oda anormal bişey göstermiyor. bi yardımcı olursan my.cnf optimizesinde sevinirim...
 

iyinet

Root
Admin
Hosting Firması
Katılım
2 Eylül 2002
Mesajlar
5,028
Reaction score
62
Konum
Sakarya
Ya hocam :) gerçekten güldüm. Neyse uçma tabirim Mysql in sürekli kapanması yani kendi kendine kapanıyor. (uçma) tabiri oydu. Mytop bile kurdum ama pek fazla bişeyde göremedim açıkcası apache statuste kurdum oda anormal bişey göstermiyor. bi yardımcı olursan my.cnf optimizesinde sevinirim...

MySQL loglarina baktinmi? Ne diyor log?
 

aXzel

0
İyinet Üyesi
Katılım
13 Mayıs 2007
Mesajlar
1,310
Reaction score
0
top cıktısı


27784 root 16 0 30236 15m 5376 R 30 0.8 0:23.31 php
27647 nobody 15 0 48684 28m 15m S 15 1.4 0:28.53 httpd
2574 mysql 15 0 409m 183m 3408 S 14 9.1 537:16.62 mysqld
27826 nobody 16 0 47300 23m 11m S 13 1.1 0:09.06 httpd
27843 nobody 15 0 48940 24m 11m R 12 1.2 0:04.99 httpd
27261 nobody 16 0 48684 28m 15m S 12 1.4 0:59.91 httpd
27845 nobody 16 0 49680 23m 9792 R 11 1.2 0:06.18 httpd
27814 nobody 15 0 47332 20m 9224 S 9 1.0 0:02.78 httpd
27594 nobody 16 0 48704 27m 14m S 9 1.4 0:37.06 httpd
27790 nobody 16 0 48988 28m 14m R 9 1.4 0:09.84 httpd
27799 nobody 16 0 46468 20m 9800 R 7 1.0 0:02.43 httpd
27827 nobody 15 0 49824 20m 6108 S 7 1.0 0:07.52 httpd
27692 nobody 15 0 49136 28m 14m R 6 1.4 0:15.43 httpd
27671 nobody 15 0 48900 28m 15m R 6 1.4 0:21.89 httpd
27656 nobody 15 0 49036 27m 14m S 6 1.4 0:17.78 httpd
27825 nobody 15 0 47088 22m 10m S 5 1.1 0:04.79 httpd
27786 nobody 15 0 48704 27m 14m S 4 1.4 0:03.03 httpd
27887 nobody 15 0 47304 19m 7988 S 3 1.0 0:04.19 httpd
27810 nobody 16 0 48768 27m 14m S 3 1.4 0:12.20 httpd
27793 nobody 15 0 51864 26m 11m S 3 1.3 0:03.81 httpd
27638 nobody 16 0 48756 27m 14m R 1 1.4 0:13.14 httpd
27570 nobody 15 0 49072 28m 14m S 1 1.4 0:22.46 httpd
27660 nobody 16 0 51356 30m 14m R 0 1.5 0:19.84 httpd
27794 nobody 18 0 45264 13m 4168 S 0 0.7 0:04.22 httpd
27795 nobody 15 0 49588 25m 11m S 0 1.2 0:03.03 httpd


my.cnf bilgileri



[mysql.server]
user=mysql

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout


sunucu:Intel(R) Core(TM)2 Duo CPU E4500 2.20GHz 2gb ramli

gunluk toplam 50k tekil alan bir sunucu ancak bukadar kasması cok sıkıyo canımı bazen giremiyom bile


İyinet yardımların için çok teşekkür ederim..
 

iyinet

Root
Admin
Hosting Firması
Katılım
2 Eylül 2002
Mesajlar
5,028
Reaction score
62
Konum
Sakarya

aXzel

0
İyinet Üyesi
Katılım
13 Mayıs 2007
Mesajlar
1,310
Reaction score
0
teşekkür ederim iyinet konu ve ayarlar için :) sizin eliniz degince bir başka oluyor ..
 

maxcilopez

0
İyinet Üyesi
Katılım
27 Ekim 2006
Mesajlar
545
Reaction score
0
iyi günler mrb Makina özellikleri
PHP:
Data Center: Almanya - Netdirekt
İşlemci (CPU): P4 3000 Mhz
Hafıza (RAM): 2048 MB DDR
Disk (HDD): 2x120 GB
Trafik (BW): 4000 GB/Ay
IP Adresi: 3 Adet
Bağlantı: 100 Mbit
İşletim Sistemi: CentOS 4.5

Sorunum cpu %90 lara kadar çıkıyor Loadlar 50-60 lara kadar çıkıyor sitenin hiti 60k file cache kullanılıyor.

PHP:
[root@server ~]# top
top - 20:56:48 up 2 days,  6:29,  1 user,  load average: 5.74, 3.96, 4.04
Tasks: 249 total,   3 running, 235 sleeping,  11 stopped,   0 zombie
Cpu(s): 90.4% us,  7.0% sy,  0.0% ni,  2.3% id,  0.0% wa,  0.3% hi,  0.0% si
Mem:   1025760k total,   943892k used,    81868k free,    79596k buffers
Swap:  2096472k total,    65532k used,  2030940k free,   460460k cached

  PID USER      PR  NI %CPU    TIME+  %MEM  VIRT  RES  SHR S COMMAND
11238 mysql     15   0  175 360:19.28  4.0  150m  40m 3276 S mysqld
 5090 nobody    15   0    2   0:03.59  1.2 25404  11m 3948 S httpd
 4361 nobody    15   0    1   0:03.83  1.3 26980  13m 3944 S httpd
 4861 nobody    15   0    1   0:09.76  1.2 25460  11m 3944 S httpd
 4948 nobody    15   0    1   0:04.13  1.2 25368  11m 3944 S httpd
14169 nobody    15   0    1   0:01.44  1.2 25484  11m 3936 S httpd
14717 nobody    15   0    1   0:01.10  1.2 25392  11m 3940 R httpd
 4100 nobody    15   0    1   0:04.31  1.3 26240  12m 3952 S httpd
 4463 nobody    15   0    1   0:03.96  1.2 25372  11m 3952 S httpd
 5083 nobody    15   0    1   0:03.22  1.2 25376  11m 3944 S httpd
12710 nobody    15   0    1   0:01.48  1.2 25572  11m 3940 S httpd
13248 nobody    15   0    1   0:00.37  1.1 25336  11m 3936 S httpd
14680 nobody    15   0    1   0:00.84  1.2 25372  11m 3936 S httpd
14718 nobody    15   0    1   0:00.86  1.2 25372  11m 3940 S httpd
16452 root      16   0    1   0:02.08  0.1  2548 1116  780 R top
 1413 nobody    15   0    0   0:05.71  1.2 25372  11m 3956 S httpd
 1547 nobody    15   0    0   0:03.94  1.2 25372  11m 3944 S httpd
 2362 nobody    16   0    0   0:05.31  1.2 25396  11m 3952 S httpd
 2509 nobody    15   0    0   0:05.69  1.3 26420  12m 3952 S httpd
 4330 nobody    16   0    0   0:03.63  1.2 25496  11m 3940 S httpd
 5181 nobody    15   0    0   0:04.26  1.2 25400  11m 3956 S httpd
 5407 nobody    15   0    0   0:03.05  1.2 25376  11m 3944 S httpd
 5777 nobody    15   0    0   0:03.66  1.2 25360  11m 3948 S httpd
 5795 nobody    16   0    0   0:03.39  1.6 29468  15m 3952 S httpd
 9905 nobody    15   0    0   0:10.29  1.2 25380  11m 3992 S httpd
12417 nobody    15   0    0   0:01.31  1.2 25368  11m 3944 S httpd
12431 nobody    15   0    0   0:03.91  1.2 25380  11m 3940 S httpd
12576 nobody    15   0    0   0:00.92  1.1 25340  11m 3548 S httpd
12713 nobody    15   0    0   0:01.13  1.2 25388  11m 3952 S httpd
13781 nobody    15   0    0   0:01.31  1.2 25632  11m 3948 S httpd
14058 nobody    16   0    0   0:01.07  1.2 25400  11m 3944 S httpd
14165 nobody    16   0    0   0:01.19  1.2 25376  11m 3944 S httpd
14730 nobody    15   0    0   0:01.39  1.2 25372  11m 3944 S httpd
16469 nobody    15   0    0   0:00.67  1.1 25448  11m 3940 S httpd
22578 nobody    15   0    0   0:05.98  1.2 25372  11m 3956 S httpd
31066 nobody    15   0    0   0:09.28  1.3 26240  12m 4004 S httpd
    1 root      16   0    0   0:03.04  0.0  3060  452  424 S init
    2 root      RT   0    0   0:00.09  0.0     0    0    0 S migration/0
    3 root      34  19    0   0:00.06  0.0     0    0    0 S ksoftirqd/0
Sitemin çoğu sayfası cache ile html ye çevrilmesine rağmen açılması 10 sn yeyi
buluyor.
mysql> show processlist;
komutundada max 50-60 satır bulunuyor.

Eğerki apache ve mysql li cronjob ile 10 dk bir restart ettirmezsem sayfaların açılmaı 45-50 sn yeyi buluyor ve load lar 45-50 lere çıkıyor.

/etc/my.cnf
PHP:
[mysqld]
set-variable = max_connections=500
safe-show-database

Önerinizi bekliyorum tşk...
 

mrtcbks

0
İyinet Üyesi
Katılım
17 Ekim 2007
Mesajlar
167
Reaction score
0
Makina özelliklerinde ram 2gb demişsiniz top da 1gb gösteriyor.
Vbulletin tarzı forum varsa bu tür özelliklerdeki makina iş görmez yinede iyinet size bir my.cnf hazırlar belki :)
 

ceyhun81

0
İyinet Üyesi
Katılım
16 Ocak 2008
Mesajlar
42
Reaction score
0
Merhaba;

Tüm sayfaları detaylı olarak inceledim. Okudum ve ona göre ayarlarımı yaptım..
Iyinet saolsun, çok yardımı dokundu. ama burada kendi makinamın konfigrasyonua uygun bir makina göremedim..

Okuduğumda da , artık kendiniz yapın demişsiniz Sayın Iyinet;

En son kendim bir ayarlama yaptım 2 gün sonra onun sonucunu yazsam yardımcı olurmusun?

HP DL280G5

10 GB ECC Reg. Ram
Xeon Quad Core E5420 @ 2.50GHz 6 MB cache
3x 146gb 15.000 rpm raid 1

yardımcı olursan sevinirim. top , tuning-primer ve şuanki my.cnf çıktılarını göndermek isterim..

teşekkürler
 

i.ari

0
İyinet Üyesi
Katılım
16 Aralık 2006
Mesajlar
4,437
Reaction score
6
Konum
Ankara
İyinet,
bendede
Intel Core 2 Quad 4*2,4 Ghz
8192 MB DDR RAM

Makine var yardımcı olursan sevinirim :)
 

SNaRe

0
İyinet Üyesi
Katılım
2 Eylül 2006
Mesajlar
0
Reaction score
0
Bu konuya yardım devam ediyormu. mysql sorunum var optimize gerekiyor galiba.
top sonucum
Kod:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 3306 mysql     15   0  129m  32m 4456 S 26.5  1.6  12:16.25 mysqld
 9399 apache    16   0 39232  21m 3760 S 19.2  1.1   0:03.52 httpd
 9327 apache    15   0 39132  21m 3600 S 14.9  1.0   0:01.30 httpd
 8740 apache    15   0 38972  21m 4384 S 11.9  1.1   0:06.85 httpd
 9388 apache    15   0 39492  21m 3864 S 11.9  1.1   0:03.88 httpd
 8604 apache    16   0 39520  22m 4508 S  9.3  1.1   0:05.16 httpd
 9376 apache    16   0 35108  17m 4460 S  0.7  0.9   0:00.49 httpd
 9381 apache    16   0 39048  21m 4372 R  0.7  1.1   0:01.90 httpd
 9385 apache    15   0 37840  20m 3860 S  0.7  1.0   0:01.09 httpd
 8301 apache    15   0 39544  22m 4384 S  0.3  1.1   0:05.13 httpd
 8597 apache    15   0 39492  22m 4396 S  0.3  1.1   0:03.71 httpd
 8680 apache    15   0 39368  21m 3776 S  0.3  1.1   0:04.71 httpd
 8697 apache    15   0 40452  22m 3812 S  0.3  1.1   0:03.94 httpd
 8860 apache    15   0 38700  21m 4356 S  0.3  1.1   0:02.24 httpd
 9179 apache    15   0 39524  21m 3760 S  0.3  1.1   0:02.98 httpd
 9396 apache    15   0 39008  20m 3592 S  0.3  1.0   0:01.08 httpd
 9398 apache    15   0 35472  17m 3744 S  0.3  0.9   0:00.62 httpd
 9400 apache    15   0 39132  21m 4340 S  0.3  1.1   0:01.41 httpd
 9401 apache    15   0 39016  20m 3588 S  0.3  1.0   0:01.35 httpd
 9402 apache    15   0 37824  19m 3576 S  0.3  1.0   0:00.45 httpd
 9524 root      16   0  3568 1048  780 R  0.3  0.1   0:00.05 top


my.conf dosyam
Kod:
[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

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 

sanatci

0
İyinet Üyesi
Katılım
7 Ağustos 2008
Mesajlar
2
Reaction score
0
my sql ayarları Performansı nasıl arttırabilirim

Merhaba,
Yaklaşık 50 civarı kullanıcının kullandığı büyüklüğü (index dahil) de 1.2 GB olan bir MYSQL veritabanı kullanıyoruz. Aynı veritabanı günde 300 civarı ziyaret alan bir websitesi tarafından da eş zamanlı kullanılıyor. Zaman zaman trafik aşırı derecede artabiliyor.
Donanım olarak HP380G5 üzerinde, 8GB Bellek, Quad Core XEON 2.5 işlemci, 3x146 GB SAS Raid 5 disk şeklinde bir sunucumuz var.
Windows 2003 Server kurulu, MYSQL 5.0.45 Community Ed.

1) Sunucuda yeterli bellek var, bu durumda performans için nasıl bir ayar doğru olur ?
2) İşlemci Quad Core XEON olduğu için 4 çekirdek var. Bu dört çekirdekten de sistemin etkin yararlanmasını nasıl sağlarım ?
Çok teşekkürler,
Gürbüz Sanatçı


MySql my.ini dosyası üzerinde epeyce oynadıktan sonra son şekli :
### my.ini ###
[client]
port=3306
[mysql]
default-character-set=utf8
[mysqld]
port=3306
basedir="C:/Program Files/MySQL/MySQL Server 5.0/"
datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/"
default-character-set=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=160
query_cache_size=128M
table_cache=320
tmp_table_size=103M
thread_cache_size=8
myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100G
myisam_sort_buffer_size=128M
key_buffer_size=16M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_data_home_dir="C:/MySQL Datafiles/"
innodb_additional_mem_pool_size=12M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=6M
innodb_buffer_pool_size=1024M
innodb_log_file_size=114M
innodb_thread_concurrency=8
### end my.ini ###
 

ruby

0
İyinet Üyesi
Katılım
8 Temmuz 2008
Mesajlar
141
Reaction score
0
model name : Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz
stepping : 2
cpu MHz : 1333.000
cache size : 2048 KB

2 Gb Ram bir aletim var ve aşagıdaki gibi my.cnf ayarlarım var bir türlü 18 20 arası load dan aşagı düşmedi acaba my.cnf mi yüksek deneyiminiz ile düzenleyebilirmisiniz?

[mysqld]
skip-locking
log-slow-queries = /var/log/mysql_slow.log
log-queries-not-using-indexes
long_query_time = 5
query_cache_limit=1M
query_cache_size=128M
query_cache_type=1
key_buffer=768M
max_connections=300
join_buffer=2M
interactive_timeout=30
wait_timeout=30
connect_timeout=10
thread_cache_size=128
table_cache=600
low_priority_updates=1
concurrent_insert=2
thread_concurrency=2
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 

iyinet

Root
Admin
Hosting Firması
Katılım
2 Eylül 2002
Mesajlar
5,028
Reaction score
62
Konum
Sakarya
model name : Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz
stepping : 2
cpu MHz : 1333.000
cache size : 2048 KB

2 Gb Ram bir aletim var ve aşagıdaki gibi my.cnf ayarlarım var bir türlü 18 20 arası load dan aşagı düşmedi acaba my.cnf mi yüksek deneyiminiz ile düzenleyebilirmisiniz?

1. Serverınızı mysql mi yavaşlatıyor? (ps -ef yada top)
2. tuning premier scriptini çalıştırıp sonucunu buraya ekleyiniz.
 

ruby

0
İyinet Üyesi
Katılım
8 Temmuz 2008
Mesajlar
141
Reaction score
0
evet mysql sorguları nedeni ile yavaşlama oluyor Cpu %56 ve üzerine çıkıyor loadlarım yükseliyor.

MySQL Version 5.0.45-log i686

Uptime = 0 days 1 hrs 10 min 50 sec
Avg. qps = 102
Total Questions = 436092
Threads Connected = 12

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 = 5 sec.
You have 16595 out of 438145 that take longer than 5 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 = 128
Current threads_cached = 120
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 300
Current threads_connected = 8
Historic max_used_connections = 170
The number of used connections is 56% of the configured maximum.
Your max_connections variable seems to be fine.

MEMORY USAGE
Max Memory Ever Allocated : 1 G
Configured Max Per-thread Buffers : 1 G
Configured Max Global Buffers : 906 M
Configured Max Memory Limit : 2 G
Physical Memory : 1.97 G

Max memory limit exceeds 90% of physical memory

KEY BUFFER

Key Buffer dan sonrası gelmiyor uzun süredir bekliyorum
 

Angelo

0
İyinet Üyesi
Katılım
13 Aralık 2004
Mesajlar
9,603
Reaction score
111
Konum
AZ
Merhaba,

Öncelikle Windows altında MySQL çalıştırmadım. Unix sistemleri için verebileceğim bazı önerileri yazacağım. Öncelikle Linux için 64 bit kernel kullanılmadığı takdirde, 8 GB Ram'den efektif yararlanılamıyor. Windows için böyle bir durum varmı araştırılabilir. Bu adımı pas geçebiliriz.

key_buffer_size, indexlerin tutulduğu hafızadır.8 GB Ram'li bir makinada 16M oldukça düşük, bunu en az 1 GB'a çıkarmanızı öneririm. MySQL'in boyutu 1,2 GB olduğuna göre bunun yeteceğini düşünüyorum. Bunu yaptıktan sonra makinadan istatistik alıp key_read, key_read_requests, key_write, key_write requests değişkenlerini postalarsanız daha sağlıklı bir şey söylenebilir.

Benzer ve yinelenen sorgularınız varsa, cache özelliği çok yardımcı olur. query_cache_size parametresini yükseltebilirsiniz.

Herhangi bir wait, connect_timeout parametresi göremedim
wait_timeout=3
connect_timeout=5
eklenebilir.

Istatistiklerden created_tmp_disk_tables değişkeninin büyüklüğüne bakarak konfigurasyondaki tmp_table_size değişkenini yükseltebilirsiniz. Memory'nin yetmediği durumlarda diske yazacaktır. Bu performans kaybına yol açar.

Ayrıca sort ve read_buffer'larında en az 5-6 katına çıkartılması güvenlidir makinanızın büyüklüğüne oranla. Hatta istatistikler izlenerek daha bile arttırılabilir. Sanırım standart my.cnf'dan başlamışsınız. my-huge.cnf'dan başlamak daha bile iyi olur. Çünkü postaladığınız konfigurasyon büyük ihtimalle 512 MB ya 1 GB lık rame sahip bir makina için optimize.

Bu makina ile çok büyük bir darboğaz yaşayabileceğinizi düşünmüyorum, eğer ultra yoğun bir işlem yapılmıyorsa.



Merhaba,
Yaklaşık 50 civarı kullanıcının kullandığı büyüklüğü (index dahil) de 1.2 GB olan bir MYSQL veritabanı kullanıyoruz. Aynı veritabanı günde 300 civarı ziyaret alan bir websitesi tarafından da eş zamanlı kullanılıyor. Zaman zaman trafik aşırı derecede artabiliyor.
Donanım olarak HP380G5 üzerinde, 8GB Bellek, Quad Core XEON 2.5 işlemci, 3x146 GB SAS Raid 5 disk şeklinde bir sunucumuz var.
Windows 2003 Server kurulu, MYSQL 5.0.45 Community Ed.

1) Sunucuda yeterli bellek var, bu durumda performans için nasıl bir ayar doğru olur ?
2) İşlemci Quad Core XEON olduğu için 4 çekirdek var. Bu dört çekirdekten de sistemin etkin yararlanmasını nasıl sağlarım ?
Çok teşekkürler,
Gürbüz Sanatçı


MySql my.ini dosyası üzerinde epeyce oynadıktan sonra son şekli :
### my.ini ###
[client]
port=3306
[mysql]
default-character-set=utf8
[mysqld]
port=3306
basedir="C:/Program Files/MySQL/MySQL Server 5.0/"
datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/"
default-character-set=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=160
query_cache_size=128M
table_cache=320
tmp_table_size=103M
thread_cache_size=8
myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100G
myisam_sort_buffer_size=128M
key_buffer_size=16M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_data_home_dir="C:/MySQL Datafiles/"
innodb_additional_mem_pool_size=12M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=6M
innodb_buffer_pool_size=1024M
innodb_log_file_size=114M
innodb_thread_concurrency=8
### end my.ini ###
 

iyinet

Root
Admin
Hosting Firması
Katılım
2 Eylül 2002
Mesajlar
5,028
Reaction score
62
Konum
Sakarya
evet mysql sorguları nedeni ile yavaşlama oluyor Cpu %56 ve üzerine çıkıyor loadlarım yükseliyor.



Key Buffer dan sonrası gelmiyor uzun süredir bekliyorum

Çok yoğun sistemlerde bu oldukça uzun sürer, sonunda gelecektir o zaman onu da eklersin.
 

ruby

0
İyinet Üyesi
Katılım
8 Temmuz 2008
Mesajlar
141
Reaction score
0
MySQL Version 5.0.45-log i686

Uptime = 0 days 1 hrs 10 min 50 sec
Avg. qps = 102
Total Questions = 436092
Threads Connected = 12

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/...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 = 5 sec.
You have 16595 out of 438145 that take longer than 5 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/...-recovery.html

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

MAX CONNECTIONS
Current max_connections = 300
Current threads_connected = 8
Historic max_used_connections = 170
The number of used connections is 56% of the configured maximum.
Your max_connections variable seems to be fine.

MEMORY USAGE
Max Memory Ever Allocated : 1 G
Configured Max Per-thread Buffers : 1 G
Configured Max Global Buffers : 906 M
Configured Max Memory Limit : 2 G
Physical Memory : 1.97 G

Max memory limit exceeds 90% of physical memory

KEY BUFFER
Current MyISAM index space = 408 M
Current key_buffer_size = 768 M
Key cache miss rate is 1 : 3385
Key buffer fill ratio = 2.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 = 128 M
Current query_cache_used = 56 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 43.82 %
Current query_cache_min_res_unit = 4 K
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 = 16.00 M
You have had 565 queries where a join could not use an index properly
join_buffer_size >= 4 M
This is not advised
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.

OPEN FILES LIMIT
Current open_files_limit = 2558 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 = 1024 tables
You have a total of 1248 tables
You have 1024 open tables.
Current table_cache hit rate is 48%, 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 49702 temp tables, 14% 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 = 1671 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 123
You may benefit from selective use of InnoDB.


tuning-primer.sh çalıştırınca yukarıdaki tablo ile karşı karşıya kalmaktayım.
 

ruby

0
İyinet Üyesi
Katılım
8 Temmuz 2008
Mesajlar
141
Reaction score
0
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -


MySQL Version 5.0.45 i686

Uptime = 0 days 22 hrs 37 min 4 sec
Avg. qps = 61
Total Questions = 4967437
Threads Connected = 3


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 NOT enabled.
Current long_query_time = 10 sec.
You have 621 out of 4968241 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 = 384
Current threads_cached = 78
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 = 3
Historic max_used_connections = 81
The number of used connections is 16% of the configured maximum.
Your max_connections variable seems to be fine.


MEMORY USAGE
Max Memory Ever Allocated : 387 M
Configured Max Per-thread Buffers : 1 G
Configured Max Global Buffers : 170 M
Configured Max Memory Limit : 1 G
Physical Memory : 1.97 G
Max memory limit seem to be within acceptable norms


KEY BUFFER
Current MyISAM index space = 406 M
Current key_buffer_size = 128 M
Key cache miss rate is 1 : 3631
Key buffer fill ratio = 17.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 = 32 M
Current query_cache_used = 18 M
Current query_cache_limit = 4 M
Current Query cache Memory fill ratio = 59.37 %
Current query_cache_min_res_unit = 4 K
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 1413 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 = 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 1280 tables
You have 1615 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 91662 temp tables, 21% 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 = 1130 : 1
read_buffer_size seems to be fine


TABLE LOCKING
Current Lock Wait ratio = 1 : 140
You may benefit from selective use of InnoDB.
If you have a high concurrency of inserts on Dynamic row-length tables
consider setting 'concurrent_insert=2'.

22 saatlik bir çıktı koyabildim alet çakılıyor çünkü
 

ruby

0
İyinet Üyesi
Katılım
8 Temmuz 2008
Mesajlar
141
Reaction score
0
[root@sun399 ~]# ./tuning-primer.sh
mysqld is alive

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

MySQL Version 5.0.45 i686

Uptime = 0 days 1 hrs 52 min 7 sec
Avg. qps = 129
Total Questions = 874506
Threads Connected = 5

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 NOT enabled.
Current long_query_time = 10 sec.
You have 3 out of 874560 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 = 384
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 = 8
Historic max_used_connections = 15
The number of used connections is 3% 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

MEMORY USAGE
Max Memory Ever Allocated : 210 M
Configured Max Per-thread Buffers : 1 G
Configured Max Global Buffers : 170 M
Configured Max Memory Limit : 1 G
Physical Memory : 1.97 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 387 M
Current key_buffer_size = 128 M
Key cache miss rate is 1 : 918
Key buffer fill ratio = 50.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 = 32 M
Current query_cache_used = 17 M
Current query_cache_limit = 4 M
Current Query cache Memory fill ratio = 53.19 %
Current query_cache_min_res_unit = 4 K
Query Cache is 21 % 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 read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 63 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 = 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 1035 tables
You have 1144 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 26243 temp tables, 50% 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 = 1872 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 49
You may benefit from selective use of InnoDB.
If you have a high concurrency of inserts on Dynamic row-length tables
consider setting 'concurrent_insert=2'.
7 gün çalışarak az önce aldım çıktıyı kontrol edebilirmiyiz?

my.cnf dosyam ise

[mysqld]
skip-locking
skip-name-resolve
max_connections = 500
thread_cache_size = 384
key_buffer = 128M
query_cache_type = 1
query_cache_size = 32M
query_cache_limit = 4M
table_cache = 2000
low_priority_updates = 1
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst