Merhaba...
Benim yeni aldığım sunucumda load problemleri var. Sorun scriptimden veya sorgularımdan değil yani daha önce problem yaşamıyordum. Ve sorgular konusunda gerçekten çok titizimdir. Ama my.cnf'deki ayarlar çok kötü sanırım. yardımcı olursanız sevinirim..
Sunucum: intel p4 3.0 dual core, 2GB Ram
Centos 4.3, Mysql 5.0
Top Çıktısı:
My.cnf içeriği
Benim yeni aldığım sunucumda load problemleri var. Sorun scriptimden veya sorgularımdan değil yani daha önce problem yaşamıyordum. Ve sorgular konusunda gerçekten çok titizimdir. Ama my.cnf'deki ayarlar çok kötü sanırım. yardımcı olursanız sevinirim..
Sunucum: intel p4 3.0 dual core, 2GB Ram
Centos 4.3, Mysql 5.0
Top Çıktısı:
Kod:
top - 15:42:07 up 1 day, 1:16, 1 user, load average: 31.18, 14.91, 22.08
Tasks: 251 total, 2 running, 249 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.3% us, 3.0% sy, 0.0% ni, 0.0% id, 84.6% wa, 0.2% hi, 0.0% si
Mem: 2066800k total, 1491372k used, 575428k free, 11040k buffers
Swap: 2031608k total, 120980k used, 1910628k free, 888480k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2172 mysql 16 0 859m 109m 2628 S 27 5.4 0:15.09 mysqld
1178 nobody 15 0 24004 11m 1920 S 0 0.6 0:00.49 httpd
1191 nobody 15 0 21264 9800 2312 S 0 0.5 0:00.38 httpd
1271 nobody 15 0 17260 5452 1924 S 0 0.3 0:00.21 httpd
1308 nobody 15 0 23992 11m 1932 S 0 0.6 0:00.91 httpd
1309 nobody 17 0 21364 9552 1948 S 0 0.5 0:00.32 httpd
1312 nobody 15 0 24000 11m 1940 S 0 0.6 0:00.58 httpd
1321 nobody 15 0 24000 11m 1928 S 0 0.6 0:00.54 httpd
1327 nobody 15 0 16968 5180 1924 S 0 0.3 0:00.10 httpd
1335 nobody 15 0 21384 9984 2372 S 0 0.5 0:00.70 httpd
2185 root 17 0 3416 1068 760 R 0 0.1 0:00.78 top
1 root 16 0 2056 272 244 S 0 0.0 0:12.93 init
2 root RT 0 0 0 0 S 0 0.0 0:00.09 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.05 ksoftirqd/0
My.cnf içeriği
Kod:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking # 1 mysql varsa
skip-innodb # innodb kullanilmiyorsa
key_buffer = 784M # 1Gb bellek icin 384M, 512Mb icin 192M
table_cache = 512
max_connections = 600
query-cache-type = 1 # query cache mysql i hizlandirir, 1=acik
query-cache-size = 32M # kullanilacak query cache miktari
max_allowed_packet=64M # mysqlhotcopy icin
wait_timeout=3600 # mysqlhotcopy icin
[mysql.server]
user=mysql
basedir=/var/lib
[safe_mysqld]
open_files_limit=18192
[mysqldump]
quick
max_allowed_packet=32M
[mysql]
no-auto-rehash
#safe-updates
[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=32M
write_buffer=32M
[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=32M
write_buffer=32M