웹서버가 갑자기 이상합니다. 조언 부탁드립니다.
웹서버1대 디비서버2대 이렇게 돌아 가고 있는데요.
디비서버의 부하률은 load average: 0.19, 0.18, 0.17
되게 널널합니다.
그런데, 웹서버의 부하률은 load average: 30.70, 25.81, 22.69
너무 높습니다.
따라서 사이트 속도도 너무 느리구요.
그런데, 정작 cpu 사용률은
Cpu(s): 0.8% us, 0.2% sy, 0.0% ni, 85.4% id, 13.5% wa, 0.0% hi, 0.0% si
이 정도 수치로 매우 낮습니다.
Mem: 2073296k total, 2056324k used, 16972k free, 1536k buffers
Swap: 2031608k total, 1930880k used, 100728k free, 11156k cached
메모리 사용률은 이정도가 되구요.
트래픽을 체크 해보면, 오늘 방문자가 특별히 많은것도 아닌데, 오늘 따라 사이트가 너무 느리네요.
ps -ax 해서 문제의 요지가 있는 프로세서가 혹시 있나 아무리 체크 해봐도 아파치 프로세서 이외에는 별 문제되는게 없는것 같습니다.
어느부분을 체크 해봐야될지 조언 부탁드립니다.
참고로 centos 4점대입니다.
아파치는 2점대이고 --with-mpm=worker 로 설치 했습니다.
Timeout 30
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 2
< IfModule mpm_worker_module > StartServers 20 MaxClients 500 MinSpareThreads 25 MaxSpareThreads 500 ThreadsPerChild 25 MaxRequestsPerChild 0 < /IfModule >
ps ax
PID TTY STAT TIME COMMAND
1 ? S 14:08 init [3]
2 ? S 0:00 [migration/0]
3 ? SN 0:00 [ksoftirqd/0]
4 ? S 0:00 [migration/1]
5 ? SN 0:00 [ksoftirqd/1]
6 ? S 0:00 [migration/2]
7 ? SN 0:00 [ksoftirqd/2]
8 ? S 0:00 [migration/3]
9 ? SN 0:00 [ksoftirqd/3]
10 ? S 0:00 [migration/4]
11 ? SN 0:00 [ksoftirqd/4]
12 ? S 0:00 [migration/5]
13 ? SN 0:00 [ksoftirqd/5]
14 ? S 0:00 [migration/6]
15 ? SN 0:00 [ksoftirqd/6]
16 ? S 0:00 [migration/7]
17 ? SN 0:00 [ksoftirqd/7]
18 ? S< 0:00 [events/0]
19 ? S< 0:00 [events/1]
20 ? S< 0:00 [events/2]
21 ? S< 0:00 [events/3]
22 ? S< 0:00 [events/4]
23 ? S< 0:00 [events/5]
24 ? S< 0:00 [events/6]
25 ? S< 0:00 [events/7]
26 ? S< 0:00 [khelper]
27 ? S< 0:00 [kacpid]
80 ? S< 0:00 [kblockd/0]
81 ? S< 0:00 [kblockd/1]
82 ? S< 0:00 [kblockd/2]
83 ? S< 0:00 [kblockd/3]
84 ? S< 0:00 [kblockd/4]
85 ? S< 0:00 [kblockd/5]
86 ? S< 0:00 [kblockd/6]
87 ? S< 0:00 [kblockd/7]
88 ? S 0:00 [khubd]
108 ? S< 0:00 [aio/0]
109 ? S< 0:00 [aio/1]
110 ? S< 0:00 [aio/2]
107 ? D 578:04 [kswapd0]
111 ? S< 0:00 [aio/3]
112 ? S< 0:00 [aio/4]
113 ? S< 0:00 [aio/5]
114 ? S< 0:00 [aio/6]
115 ? S< 0:00 [aio/7]
259 ? S 0:00 [kseriod]
430 ? S< 0:00 [kmirrord]
454 ? S 24:10 [kjournald]
1485 ? S< s 0:00 udevd
2230 ? S< 0:00 [kauditd]
2507 ? S 0:00 [kjournald]
3994 ? Ss 4:53 syslogd -m 0
3998 ? Ss 1:42 klogd -x
4009 ? Ss 8:24 irqbalance
4115 ? Ss 0:00 /usr/sbin/acpid
4125 ? Ss 0:59 /usr/sbin/sshd
4140 ? Ss 0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
4181 ? Ss 0:00 gpm -m /dev/input/mice -t imps2
4212 ? Ss 0:00 /usr/sbin/htt -retryonerror 0
4213 ? S 0:00 htt_server -nodaemon
4223 ? Ss 4:46 crond
4248 ? Ss 1:29 xfs -droppriv -daemon
4267 ? Ss 3:24 /usr/sbin/atd
4277 ? Ssl 0:00 dbus-daemon-1 --system
4288 ? Ss 0:00 cups-config-daemon
4299 ? Ss 76:33 hald
4331 ? Ss 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a shadow
4362 tty2 Ss+ 0:00 /sbin/mingetty tty2
4363 tty3 Ss+ 0:00 /sbin/mingetty tty3
4364 tty4 Ss+ 0:00 /sbin/mingetty tty4
4365 tty5 Ss+ 0:00 /sbin/mingetty tty5
4366 tty6 Ss+ 0:00 /sbin/mingetty tty6
4405 ? S 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a shadow
4410 ? S 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a shadow
4413 ? S 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a shadow
4415 ? S 0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a shadow
5203 ? Ss 0:00 login -- root
6571 tty1 Ss+ 0:00 -bash
9518 ? Ss 8:06 proftpd: (accepting connections)
11597 ? Ss 0:04 /usr/local/apache2/bin/httpd -D SSL -k restart
25595 ? S 0:00 /usr/local/cronolog/sbin/cronolog /usr/local/apache2/log/www.error_log.%Y%m%d
25596 ? S 0:00 /usr/local/cronolog/sbin/cronolog /usr/local/apache2/log/www2.error_log.%Y%m%d
25597 ? S 0:00 /usr/local/cronolog/sbin/cronolog --symlink=/usr/local/apache2/log/www.access_log /usr/local/apache2/log/www.access_log.%Y%m%d
25598 ? S 1:45 /usr/local/cronolog/sbin/cronolog --symlink=/usr/local/apache2/log/www.access_log /usr/local/apache2/log/www2.access_log.%Y%m%d
25599 ? S 0:00 /usr/local/apache2/bin/httpd -D SSL -k restart
25600 ? Sl 43:39 /usr/local/apache2/bin/httpd -D SSL -k restart
25602 ? Sl 43:27 /usr/local/apache2/bin/httpd -D SSL -k restart
25604 ? Sl 43:23 /usr/local/apache2/bin/httpd -D SSL -k restart
25614 ? Sl 43:43 /usr/local/apache2/bin/httpd -D SSL -k restart
25633 ? Sl 43:29 /usr/local/apache2/bin/httpd -D SSL -k restart
25667 ? Sl 43:27 /usr/local/apache2/bin/httpd -D SSL -k restart
25707 ? Sl 43:25 /usr/local/apache2/bin/httpd -D SSL -k restart
25715 ? Sl 43:25 /usr/local/apache2/bin/httpd -D SSL -k restart
25754 ? Sl 43:22 /usr/local/apache2/bin/httpd -D SSL -k restart
25781 ? Sl 43:26 /usr/local/apache2/bin/httpd -D SSL -k restart
25802 ? Sl 43:14 /usr/local/apache2/bin/httpd -D SSL -k restart
25813 ? Sl 43:21 /usr/local/apache2/bin/httpd -D SSL -k restart
25881 ? Sl 43:20 /usr/local/apache2/bin/httpd -D SSL -k restart
25908 ? Sl 43:17 /usr/local/apache2/bin/httpd -D SSL -k restart
25914 ? Sl 43:28 /usr/local/apache2/bin/httpd -D SSL -k restart
25916 ? Sl 43:31 /usr/local/apache2/bin/httpd -D SSL -k restart
25918 ? Sl 43:16 /usr/local/apache2/bin/httpd -D SSL -k restart
25920 ? Sl 43:26 /usr/local/apache2/bin/httpd -D SSL -k restart
25922 ? Sl 43:25 /usr/local/apache2/bin/httpd -D SSL -k restart
25924 ? Sl 43:35 /usr/local/apache2/bin/httpd -D SSL -k restart
4133 ? S 0:00 [pdflush]
5156 ? S 0:00 [pdflush]
5288 ? Ss 0:01 sshd: root@pts/0
5290 pts/0 Ss 0:00 -bash
5691 ? Ss 0:00 /usr/local/sbin/dovecot
5692 ? S 0:00 dovecot-auth
5696 ? S 0:00 imap-login
5697 ? S 0:00 imap-login
5698 ? S 0:00 imap-login
5843 pts/1 Ss+ 0:00 -bash
5972 ? Ss 0:00 sendmail: accepting connections
5982 ? Ss 0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
6234 ? S 0:00 sendmail: ./n3KA2H0J023437 hanmal.net.: user open
6293 ? S 0:00 pop3-login
6302 ? S 0:00 pop3-login
6420 ? S 0:00 sendmail: ./n3M4PsZO032500 kr.news.fy4.b.yahoo.com.: user open
6478 ? S 0:00 pop3-login
6483 pts/0 R+ 0:00 ps ax
Mem: 2073296k total,
Mem: 2073296k total, 2056324k used, 16972k free, 1536k buffers
Swap: 2031608k total, 1930880k used, 100728k free, 11156k cached
헉... 2기가의 메모리 다 사용하고 스왑메모리도 다 사용하고 있네요.. ㅡㅡ;;;
top 명령어로 메모리 많이 잡아먹는 프로세스 체크한 뒤에 그 프로세스의
문제점부터 봐야겠네요...
_________________________________________________________
nineye's blog
_________________________________________________________
nineye's blog
top 해보면, 아파치 프로세서 밖에 없습니다.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
107 root 15 0 0 0 0 S 3 0.0 579:22.34 kswapd0
25881 daemon 25 0 474m 81m 3136 S 1 4.0 43:32.93 httpd
25922 daemon 25 0 476m 79m 3136 S 1 3.9 43:37.51 httpd
25600 daemon 17 0 476m 98m 3132 S 1 4.8 43:53.76 httpd
25604 daemon 17 0 472m 76m 3136 S 1 3.8 43:36.57 httpd
25633 daemon 19 0 474m 80m 3136 S 1 4.0 43:41.89 httpd
25754 daemon 19 0 474m 77m 3140 S 1 3.8 43:35.58 httpd
25908 daemon 25 0 472m 77m 3136 S 1 3.8 43:29.98 httpd
25916 daemon 25 0 475m 80m 3136 S 1 4.0 43:44.57 httpd
25918 daemon 25 0 473m 79m 3136 S 1 3.9 43:29.34 httpd
25920 daemon 25 0 474m 77m 3124 S 1 3.8 43:40.97 httpd
25614 daemon 17 0 476m 120m 3140 S 0 5.9 43:58.59 httpd
25667 daemon 19 0 475m 78m 3124 S 0 3.9 43:40.46 httpd
25707 daemon 20 0 475m 73m 3136 S 0 3.6 43:36.50 httpd
25715 daemon 19 0 472m 71m 3136 S 0 3.5 43:37.37 httpd
25813 daemon 25 0 474m 81m 3136 S 0 4.0 43:34.93 httpd
25914 daemon 25 0 474m 77m 3132 S 0 3.8 43:41.10 httpd
25924 daemon 25 0 475m 76m 3144 S 0 3.8 43:48.31 httpd
6615 root 16 0 2124 988 760 R 0 0.0 0:00.14 top
1 root 16 0 2396 100 80 S 0 0.0 14:08.52 init
2 root RT 0 0 0 0 S 0 0.0 0:00.36 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.01 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:00.62 migration/1
5 root 34 19 0 0 0 S 0 0.0 0:00.01 ksoftirqd/1
6 root RT 0 0 0 0 S 0 0.0 0:00.14 migration/2
7 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/2
8 root RT 0 0 0 0 S 0 0.0 0:00.12 migration/3
9 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/3
10 root RT 0 0 0 0 S 0 0.0 0:00.17 migration/4
11 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/4
12 root RT 0 0 0 0 S 0 0.0 0:00.08 migration/5
13 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/5
14 root RT 0 0 0 0 S 0 0.0 0:00.08 migration/6
15 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/6
16 root RT 0 0 0 0 S 0 0.0 0:00.05 migration/7
17 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/7
18 root 5 -10 0 0 0 S 0 0.0 0:00.33 events/0
19 root 5 -10 0 0 0 S 0 0.0 0:00.21 events/1
20 root 5 -10 0 0 0 S 0 0.0 0:00.23 events/2
21 root 5 -10 0 0 0 S 0 0.0 0:00.25 events/3
22 root 5 -10 0 0 0 S 0 0.0 0:00.29 events/4
23 root 5 -10 0 0 0 S 0 0.0 0:00.35 events/5
24 root 5 -10 0 0 0 S 0 0.0 0:00.31 events/6
25 root 5 -10 0 0 0 S 0 0.0 0:00.27 events/7
26 root 5 -10 0 0 0 S 0 0.0 0:00.00 khelper
27 root 14 -10 0 0 0 S 0 0.0 0:00.00 kacpid
80 root 5 -10 0 0 0 S 0 0.0 0:00.43 kblockd/0
81 root 5 -10 0 0 0 S 0 0.0 0:00.42 kblockd/1
82 root 5 -10 0 0 0 S 0 0.0 0:00.31 kblockd/2
83 root 5 -10 0 0 0 S 0 0.0 0:00.41 kblockd/3
84 root 5 -10 0 0 0 S 0 0.0 0:00.41 kblockd/4
85 root 5 -10 0 0 0 S 0 0.0 0:00.33 kblockd/5
86 root 5 -10 0 0 0 S 0 0.0 0:00.29 kblockd/6
아파치 재시작
아파치 재시작 하세요.
http://star4u.org
http://mirror.star4u.org
top 상태에서 대문자
top 상태에서 대문자 M(인가?)를 누르면 메모리 많이 먹는 순으로 정렬이 됩니다.
그렇게 한 번 체크하는 것이... 위의 것은 공백이 어디까진지 눈으로 보기 힘드네요.
_________________________________________________________
nineye's blog
_________________________________________________________
nineye's blog
네이트온으로 연락주세요;;
직접봐야할듯하네영~~istyles@lycos.co.kr
댓글 달기