top - 20:46:52 up 7:13, 2 users, load average: 2.25, 2.10, 2.14
Tasks: 165 total, 3 running, 161 sleeping, 0 stopped, 1 zombie
Cpu(s): 35.1% us, 4.5% sy, 0.0% ni, 55.2% id, 5.2% wa, 0.0% hi, 0.0% si
Mem: 2074052k total, 2010236k used, 63816k free, 62452k buffers
Swap: 2040244k total, 208k used, 2040036k free, 1509768k cached
[mysqld]
safe-show-database
back_log = 75
skip-innodb
max_connections = 500
key_buffer = 64M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1800
thread_cache_size = 384
wait_timeout = 45
connect_timeout = 10
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
max_connect_errors = 10
thread_concurrency = 4
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
query_cache_limit = 3M
query_cache_size = 64M
query_cache_type = 1
query_prealloc_size = 131072
query_alloc_block_size = 65536
default-storage-engine = MyISAM
[mysqld_safe]
nice = -5
open_files_limit = 8192
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
[mysqlhotcopy]
interactive-timeout
Merhabalar;
AMD Dual Opteron 248 Sunucum var.
RAM : 2GB
HDD: 2 x 250 GB SATA
cPanel 11
Centos 4.5
Apache/1.3.37
PHP/4.4.7
Mysql 4.1.22-standard
Bir Çok Script Var Sunucuda +vBulletin+vBSEO
Top:
my.cnf değerlerim:
Sunucum Mysql i Çok Fazla Kullanıyor.Yardım İçin Şimdiden Teşekkürler
[mysqld] bolumunu su sekilde degistir.
[mysqld]
safe-show-database
skip-innodb
max_connections = 500
key_buffer = 256M
table_cache = 1800
thread_cache_size = 384
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
bulk_insert_buffer_size = 8M
query_cache_size = 32M
query_cache_type = 1
default-storage-engine = MyISAM
Yardımlarınız İçin Çok Teşekkürler iyinet Fakat Loadlar Tekrardan Yüksek Size İşlemci Kullanımındaki Tabloyu Göstermek istiyorum.Sizce Bu Garip Değil mi ?
Şimdiden Teşekkürler..
top - 21:32:56 up 5:48, 1 user, load average: 17.30, 17.63, 17.78
Tasks: 343 total, 3 running, 340 sleeping, 0 stopped, 0 zombie
Cpu(s): 15.1% us, 40.0% sy, 0.0% ni, 44.3% id, 0.6% wa, 0.0% hi, 0.0% si
Mem: 4148496k total, 2654880k used, 1493616k free, 22028k buffers
Swap: 2040244k total, 8k used, 2040236k free, 1598284k cached
sverdlow' Alıntı:Sunucu Xeon 2 İşlemcili 4 Çekirdekli (Yani toplam 8 çekirdek) ve 4gb ramli bir sunucu.
400-500 bin db kaydı bulunan 3-4 site yoğun çalışıyor.
loadlar bazen %50 üzerine çıkıyor.Sunucunun çalışması fena değil ama 2-3 saniye kadar geç tepki veriyor. trafik biraz azalınca tepki problemi kalmıyor.
Optimizasyon onerisinde bulunabilmem icin su anki mysql konfigurasyonunuzu ve sisteminizde nelerin calistigini bilmem gerekiyor.
/etc/my.cnf (genellikle burada olur) icerigini buraya postalayin.
top -n1 ciktisini postalayin
netstat -an ciktisini postalayin
iptables --list -n | wc -l (cikti verirse) bunu da postalayin.
ps -ef ciktisini postalayin
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
safe-show-database
skip-innodb
max_connections = 500
key_buffer = 256M
table_cache = 1800
thread_cache_size = 384
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
bulk_insert_buffer_size = 8M
query_cache_size = 32M
query_cache_type = 1
default-storage-engine = MyISAM
log-bin
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
top - 23:32:58 up 7:48, 1 user, load average: 31.03, 25.75, 23.16
Tasks: 358 total, 1 running, 357 sleeping, 0 stopped, 0 zombie
Cpu(s): 14.8% us, 44.6% sy, 0.0% ni, 40.1% id, 0.5% wa, 0.0% hi, 0.0% si
Mem: 4148496k total, 2397280k used, 1751216k free, 33992k buffers
Swap: 2040244k total, 4192k used, 2036052k free, 1446020k cached
my.cnf şöyle;
top -n1 çıktısı
netstat -an çıktısı çok uzun bi çıktı verdi
iptables --list -n | wc -l çıktı vermedi
ps -ef de çok uzun bi çıktı verdi.
en azından idare edebilecek bi ayar da olsa sevinirim.
Bu kavramı dahi ilk kez duyuyorum. mysql in my-huge.cnf şablonunu my.cnf olarak belirlemiştim. my.cnf den mi anladınız bunu?1. MySQL relication modunda, bunu bilerek mi yapiyorsunuz, yani replication i siz mi actiniz?
2. Cok uzun dediginiz ciktilar cok onemli, sigmiyorsa txt dosyasina koyup zipleyin ve buraya upload edin.
3. top -n1 ciktisinda eksiklik var prosesler gorunmuyor
Bu kavramı dahi ilk kez duyuyorum. mysql in my-huge.cnf şablonunu my.cnf olarak belirlemiştim. my.cnf den mi anladınız bunu?
Gerekli tüm çıktıları zipleyip pmledim size. Site isimleri çıktılarda göründüğü için buradan vermiyorum.
teşekkürler.
Çok teşekkür ederim iyinet,
hemen restart attım.
Zaten 2 gündür scriptleri de optimize ediyorum, cache sistemi geliştirdim mysql yorulmasın diye.
1 saate kadar belli eder kendini.
my.cfn deki [mysqld] dışındaki bölümleri sileyim mi?
arkadaşlar
amd 3800 2 gb ram li bir makanam var bunun optimasyonu nasıl olmalı
Şimdiden Tşk ler
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
query_cache_limit=8M
query_cache_size=256M
query_cache_type=1
max_connections=500
max_user_connections=100
interactive_timeout=20
wait_timeout=20
connect_timeout=6
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=4
myisam_sort_buffer_size=64M
#log-bin
server-id=1
[mysql.server]
user=mysql
basedir=/var/lib
[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=32M
sort_buffer=32M
read_buffer=16M
write_buffer=16M
[myisamchk]
key_buffer=32M
sort_buffer=32M
read_buffer=16M
write_buffer=16M
top - 00:33:47 up 1 day, 4:40, 1 user, load average: 1.36, 1.75, 1.97
Tasks: 150 total, 5 running, 142 sleeping, 0 stopped, 3 zombie
Cpu(s): 27.1% us, 9.7% sy, 0.6% ni, 57.0% id, 5.1% wa, 0.5% hi, 0.0% si
Mem: 4090556k total, 3733492k used, 357064k free, 215036k buffers
Swap: 2096472k total, 192k used, 2096280k free, 3005584k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2383 serialtr 24 0 21304 12m 2828 R 94 0.3 0:01.02 php
1367 mysql 15 0 290m 33m 2600 S 48 0.8 0:19.30 mysqld
2404 musozluk 17 0 0 0 0 Z 12 0.0 0:00.06 php <defunct>
2347 knighton 16 0 0 0 0 Z 4 0.0 0:00.33 php <defunct>
3314 nobody 15 0 12756 6852 1416 S 4 0.2 0:14.23 httpd
1719 nobody 15 0 12732 7216 1852 S 2 0.2 0:15.52 httpd
2198 nobody 15 0 12156 6044 1328 S 2 0.1 0:00.02 httpd
31241 nobody 15 0 12288 6260 1388 S 2 0.2 0:01.31 httpd
1 root 15 0 2828 548 468 S 0 0.0 0:03.35 init
2 root RT 0 0 0 0 S 0 0.0 0:02.68 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.26 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:16.21 migration/1
5 root 34 19 0 0 0 S 0 0.0 0:03.74 ksoftirqd/1
6 root RT 0 0 0 0 S 0 0.0 0:26.68 migration/2
7 root 34 19 0 0 0 S 0 0.0 0:02.67 ksoftirqd/2
8 root RT 0 0 0 0 S 0 0.0 0:00.52 migration/3
9 root 34 19 0 0 0 S 0 0.0 0:00.03 ksoftirqd/3
10 root 5 -10 0 0 0 S 0 0.0 0:02.98 events/0
11 root 5 -10 0 0 0 S 0 0.0 0:34.47 events/1
12 root 5 -10 0 0 0 S 0 0.0 0:41.28 events/2
13 root 5 -10 0 0 0 S 0 0.0 0:00.19 events/3
14 root 7 -10 0 0 0 S 0 0.0 0:00.01 khelper
15 root 15 -10 0 0 0 S 0 0.0 0:00.00 kacpid
29 root 5 -10 0 0 0 S 0 0.0 0:00.11 kblockd/0
30 root 5 -10 0 0 0 S 0 0.0 0:01.14 kblockd/1
31 root 5 -10 0 0 0 S 0 0.0 0:01.55 kblockd/2
32 root 5 -10 0 0 0 S 0 0.0 0:00.00 kblockd/3
33 root 25 0 0 0 0 S 0 0.0 0:00.00 khubd
50 root 15 0 0 0 0 S 0 0.0 0:29.78 pdflush
52 root 15 0 0 0 0 S 0 0.0 0:14.85 kswapd0
53 root 10 -10 0 0 0 S 0 0.0 0:00.00 aio/0
54 root 5 -10 0 0 0 S 0 0.0 0:00.00 aio/1
55 root 5 -10 0 0 0 S 0 0.0 0:00.00 aio/2
56 root 5 -10 0 0 0 S 0 0.0 0:00.00 aio/3
200 root 25 0 0 0 0 S 0 0.0 0:00.00 kseriod
326 nobody 15 0 12152 6016 1296 S 0 0.1 0:00.05 httpd
[root@server etc]# iptables --list -n | wc -l
132
[root@server etc]#
[root@server etc]# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Aug20 ? 00:00:03 init [3]
root 2 1 0 Aug20 ? 00:00:02 [migration/0]
root 3 1 0 Aug20 ? 00:00:00 [ksoftirqd/0]
root 4 1 0 Aug20 ? 00:00:16 [migration/1]
root 5 1 0 Aug20 ? 00:00:03 [ksoftirqd/1]
root 6 1 0 Aug20 ? 00:00:26 [migration/2]
root 7 1 0 Aug20 ? 00:00:02 [ksoftirqd/2]
root 8 1 0 Aug20 ? 00:00:00 [migration/3]
root 9 1 0 Aug20 ? 00:00:00 [ksoftirqd/3]
root 10 1 0 Aug20 ? 00:00:02 [events/0]
root 11 1 0 Aug20 ? 00:00:34 [events/1]
root 12 1 0 Aug20 ? 00:00:41 [events/2]
root 13 1 0 Aug20 ? 00:00:00 [events/3]
root 14 10 0 Aug20 ? 00:00:00 [khelper]
root 15 10 0 Aug20 ? 00:00:00 [kacpid]
root 29 10 0 Aug20 ? 00:00:00 [kblockd/0]
root 30 10 0 Aug20 ? 00:00:01 [kblockd/1]
root 31 10 0 Aug20 ? 00:00:01 [kblockd/2]
root 32 10 0 Aug20 ? 00:00:00 [kblockd/3]
root 33 1 0 Aug20 ? 00:00:00 [khubd]
root 50 10 0 Aug20 ? 00:00:29 [pdflush]
root 52 1 0 Aug20 ? 00:00:14 [kswapd0]
root 53 10 0 Aug20 ? 00:00:00 [aio/0]
root 54 10 0 Aug20 ? 00:00:00 [aio/1]
root 55 10 0 Aug20 ? 00:00:00 [aio/2]
root 56 10 0 Aug20 ? 00:00:00 [aio/3]
root 200 1 0 Aug20 ? 00:00:00 [kseriod]
nobody 326 20622 0 00:22 ? 00:00:00 /usr/local/apache/bin/httpd -DSSL
root 460 1 0 Aug20 ? 00:00:00 [scsi_eh_0]
root 483 1 0 Aug20 ? 00:02:09 [kjournald]
root 1334 1 0 00:24 pts/4 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysq
mysql 1367 1334 17 00:24 pts/4 00:00:36 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=
root 1687 1 0 Aug20 ? 00:00:00 udevd
root 1711 20622 0 Aug21 ? 00:00:00 /usr/bin/perl /usr/local/cpanel/bin/leechprotect
nobody 1712 20622 0 Aug21 ? 00:00:16 /usr/local/apache/bin/httpd -DSSL
nobody 1713 20622 0 Aug21 ? 00:00:13 /usr/local/apache/bin/httpd -DSSL
nobody 1714 20622 0 Aug21 ? 00:00:16 /usr/local/apache/bin/httpd -DSSL
nobody 1715 20622 0 Aug21 ? 00:00:13 /usr/local/apache/bin/httpd -DSSL
nobody 1719 20622 0 Aug21 ? 00:00:15 /usr/local/apache/bin/httpd -DSSL
nobody 1726 20622 0 Aug21 ? 00:00:15 /usr/local/apache/bin/httpd -DSSL
nobody 1735 20622 0 Aug21 ? 00:00:14 /usr/local/apache/bin/httpd -DSSL
nobody 1747 20622 0 Aug21 ? 00:00:12 /usr/local/apache/bin/httpd -DSSL
nobody 1758 20622 0 Aug21 ? 00:00:14 /usr/local/apache/bin/httpd -DSSL
nobody 1770 20622 0 Aug21 ? 00:00:14 /usr/local/apache/bin/httpd -DSSL
nobody 1777 20622 0 Aug21 ? 00:00:15 /usr/local/apache/bin/httpd -DSSL
nobody 1787 20622 0 Aug21 ? 00:00:15 /usr/local/apache/bin/httpd -DSSL
nobody 1797 20622 0 Aug21 ? 00:00:13 /usr/local/apache/bin/httpd -DSSL
nobody 1802 20622 0 Aug21 ? 00:00:13 /usr/local/apache/bin/httpd -DSSL
nobody 1808 20622 0 Aug21 ? 00:00:16 /usr/local/apache/bin/httpd -DSSL
root 1813 10 0 Aug20 ? 00:00:00 [kauditd]
root 1913 1 0 Aug20 ? 00:00:36 [kjournald]
root 1914 1 0 Aug20 ? 00:00:00 [kjournald]
root 1915 1 0 Aug20 ? 00:00:16 [kjournald]
root 2026 2917 0 Aug21 ? 00:00:09 /etc/authlib/authProg
nobody 2091 20622 0 Aug21 ? 00:00:15 /usr/local/apache/bin/httpd -DSSL
nobody 2132 20622 0 00:25 ? 00:00:00 /usr/local/apache/bin/httpd -DSSL
nobody 2144 20622 0 Aug21 ? 00:00:14 /usr/local/apache/bin/httpd -DSSL
mailnull 2377 1 0 00:26 ? 00:00:00 eximstats
nobody 2533 20622 0 Aug21 ? 00:00:14 /usr/local/apache/bin/httpd -DSSL
nobody 2774 20622 0 00:26 ? 00:00:00 /usr/local/apache/bin/httpd -DSSL
root 2797 1 0 Aug20 ? 00:00:07 syslogd -m 0
root 2801 1 0 Aug20 ? 00:00:00 klogd -x
root 2815 1 0 Aug20 ? 00:00:01 irqbalance
named 2831 1 0 Aug20 ? 00:04:02 /usr/sbin/named -u named -t /var/named/chroot
root 2845 14539 0 00:26 ? 00:00:00 cPhulkd - processor
root 2868 1 0 Aug21 ? 00:00:00 crond
root 2885 1 0 Aug20 ? 00:00:00 /usr/sbin/courierlogger -pid=/var/spool/authdaemon/pid -facility=mail -start /
root 2886 2885 0 Aug20 ? 00:00:00 /usr/libexec/courier-authlib/authdaemond
root 2914 2886 0 Aug20 ? 00:00:00 /usr/libexec/courier-authlib/authdaemond
root 2915 2886 0 Aug20 ? 00:00:00 /usr/libexec/courier-authlib/authdaemond
root 2916 2886 0 Aug20 ? 00:00:00 /usr/libexec/courier-authlib/authdaemond
root 2917 2886 0 Aug20 ? 00:00:00 /usr/libexec/courier-authlib/authdaemond
root 2918 2886 0 Aug20 ? 00:00:00 /usr/libexec/courier-authlib/authdaemond
root 2960 1 0 Aug20 ? 00:00:00 /usr/sbin/smartd
root 2969 1 0 Aug20 ? 00:00:00 /usr/sbin/acpid
root 2979 1 0 Aug20 ? 00:00:02 /usr/sbin/sshd
root 2992 1 0 Aug20 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
root 3059 14539 0 00:27 ? 00:00:00 cPhulkd - processor
root 3065 1 0 Aug20 ? 00:00:04 chkservd
root 3076 1 0 Aug20 ? 00:00:00 /usr/sbin/courierlogger -pid=/var/run/imapd.pid -start -name=imapd /usr/lib/co
root 3077 3076 0 Aug20 ? 00:00:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs=40 -maxperip=30
root 3085 1 0 Aug20 ? 00:00:00 /usr/sbin/courierlogger -pid=/var/run/imapd-ssl.pid -start -name=imapd-ssl /us
root 3086 3085 0 Aug20 ? 00:00:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs=40 -maxperip=30
root 3091 1 0 Aug20 ? 00:00:02 /usr/sbin/courierlogger -pid=/var/run/pop3d.pid -start -name=pop3d /usr/lib/co
root 3092 3091 0 Aug20 ? 00:00:02 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs=40 -maxperip=30
root 3097 1 0 Aug20 ? 00:00:00 /usr/sbin/courierlogger -pid=/var/run/pop3d-ssl.pid -start -name=pop3d-ssl /us
root 3098 3097 0 Aug20 ? 00:00:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs=40 -maxperip=30
nobody 3123 20622 0 Aug21 ? 00:00:12 /usr/local/apache/bin/httpd -DSSL
sebocuyu 3131 1777 1 00:27 ? 00:00:00PHP:<defunct> nobody 3148 20622 0 00:27 ? 00:00:00 /usr/local/apache/bin/httpd -DSSL nobody 3160 20622 0 00:27 ? 00:00:00 /usr/local/apache/bin/httpd -DSSL root 3206 14539 0 00:27 ? 00:00:00 cPhulkd - processor nobody 3238 20622 0 00:27 ? 00:00:00 /usr/local/apache/bin/httpd -DSSL tebesir 3311 1719 26 00:27 ? 00:00:00 [php] <defunct> nobody 3314 20622 0 Aug21 ? 00:00:14 /usr/local/apache/bin/httpd -DSSL nobody 3322 20622 0 00:27 ? 00:00:00 /usr/local/apache/bin/httpd -DSSL nobody 3333 20622 0 00:27 ? 00:00:00 /usr/local/apache/bin/httpd -DSSL nobody 3334 20622 0 00:27 ? 00:00:00 /usr/local/apache/bin/httpd -DSSL mytrnet 3337 3148 0 00:27 ? 00:00:00 [php] <defunct> mytrnet 3338 1713 0 00:27 ? 00:00:00 [php] <defunct> gokce 3339 3375 0 00:27 ? 00:00:00 /usr/bin/php index.php tebesir 3340 4409 0 00:27 ? 00:00:00 /usr/bin/php index.php mytrnet 3341 3238 0 00:27 ? 00:00:00 [php] <defunct> musozluk 3342 1808 0 00:27 ? 00:00:00 [php] <defunct> root 3343 29362 0 00:27 pts/4 00:00:00 ps -ef nobody 3369 20622 0 Aug21 ? 00:00:13 /usr/local/apache/bin/httpd -DSSL nobody 3375 20622 0 Aug21 ? 00:00:12 /usr/local/apache/bin/httpd -DSSL dbus 3984 1 0 Aug20 ? 00:00:00 dbus-daemon-1 --system root 3994 1 0 Aug20 ? 00:00:34 hald root 4016 1 0 Aug20 ? 00:00:00 /usr/sbin/portsentry -tcp root 4037 1 0 Aug20 ? 00:00:03 rrdtimer root 4039 1 0 Aug20 tty1 00:00:00 /sbin/mingetty tty1 root 4040 1 0 Aug20 tty2 00:00:00 /sbin/mingetty tty2 root 4041 1 0 Aug20 tty3 00:00:00 /sbin/mingetty tty3 root 4042 1 0 Aug20 tty4 00:00:00 /sbin/mingetty tty4 root 4043 1 0 Aug20 tty5 00:00:00 /sbin/mingetty tty5 root 4044 1 0 Aug20 tty6 00:00:00 /sbin/mingetty tty6 nobody 4409 20622 0 Aug21 ? 00:00:13 /usr/local/apache/bin/httpd -DSSL root 4674 1 0 Aug20 ? 00:00:24 perl ./read-data.pl start apps root 4681 1 0 Aug20 ? 00:02:48 perl ./read-data.pl start system root 4688 1 0 Aug20 ? 00:00:04 perl ./read-data.pl start traffic root 4845 2916 0 Aug20 ? 00:00:29 /etc/authlib/authProg root 5414 2914 0 Aug20 ? 00:00:32 /etc/authlib/authProg root 7004 1 0 Aug21 ? 00:00:00 cpsrvd - waiting for connections root 7218 2915 0 Aug20 ? 00:00:30 /etc/authlib/authProg [/quote]Şimdiden çok teşekkür ederim.