2004年10月29日金曜日

メモリ使い切り


なんだか、apacheや各種プロセスがkillされていた。

/var/log/messagesをみると、


Oct 28 18:00:16 his kernel: __alloc_pages: 0-order allocation failed (gfp=0x1d2/0)
Oct 28 18:01:25 his kernel: VM: killing process apache
Oct 28 18:01:25 his kernel: __alloc_pages: 0-order allocation failed (gfp=0x1d2/0)
[以下略]

みたいな感じ。



10分ごとにtopの結果をファイルにとっているが、それをみると、

17:50時点では重たいながらも正常で


17:50:27 up 4 days, 17:37, 1 user, load average: 8.07, 6.14, 5.42
99 processes: 94 sleeping, 4 running, 1 zombie, 0 stopped
CPU states: 59.2% user, 18.3% system, 0.7% nice, 21.8% idle
Mem: 1033616K total, 565472K used, 468144K free, 13828K buffers
Swap: 999920K total, 490880K used, 509040K free, 6620K cached

PID UID PRI STAT %CPU %MEM TIME COMMAND
4494 1005 14 R 99.5 0.1 3:37 /usr/bin/perl /usr/local/namazu/bin/mknmz
5953 0 9 D 23.8 44.8 1:43 /bin/sh /etc/cron.daily/integrit
26396 65534 9 D 5.9 4.8 1523m /usr/bin/perl /usr/bin/mhonarc /home/his/
4986 1000 12 R 4.2 0.0 0:00 /usr/bin/top -n1 -b
26597 33 9 D 1.7 0.1 0:00 /usr/sbin/apache
11 0 9 SW 0.8 0.0 15:22 kjournald
14477 0 15 R N 0.8 0.0 45:54 integrit -C /etc/integrit/integrit.conf -c
22438 33 9 S 0.8 0.1 0:00 /usr/sbin/apache
1 0 9 S 0.0 0.0 0:10 init [2]
2 0 9 SW 0.0 0.0 0:00 keventd
3 0 19 SWN 0.0 0.0 0:02 ksoftirqd_CPU0

となっている。







しかし、18:00にとったものは、1分以上遅れてファイルに書き出されている上に、

下記のように突然メモリとswapを使い切っている。


18:01:28 up 4 days, 17:48, 1 user, load average: 36.37, 29.85, 17.13
125 processes: 114 sleeping, 9 running, 2 zombie, 0 stopped
CPU states: 59.2% user, 18.4% system, 0.7% nice, 21.8% idle
Mem: 1033616K total, 1021996K used, 11620K free, 13336K buffers
Swap: 999920K total, 999920K used, 0K free, 11000K cached
PID UID PRI STAT %CPU %MEM TIME COMMAND
5 0 20 RW 79.8 0.0 15:10 kswapd
5006 0 15 R 66.9 91.4 1:29 /bin/sh /etc/cron.daily/integrit
5146 1000 15 R 8.0 0.0 0:00 /usr/bin/top -n1 -b
5120 1000 10 R 2.4 0.1 0:00 /usr/bin/perl -T -w /usr/local/bin/spamass
5136 1006 10 D 2.4 0.1 0:00 /usr/local/bin/perl /home/linew/fml/msend.
11 0 10 DW 0.8 0.0 15:22 kjournald
5001 33 9 R 0.8 0.1 0:10 /usr/sbin/apache
5114 0 9 D 0.8 0.2 0:04 /usr/bin/perl /usr/sbin/checkservice -l /v
5155 0 10 D 0.8 0.0 0:00 /bin/sh /root/bin/rdf-renew.sh
5162 33 10 D 0.8 0.1 0:00 /usr/sbin/apache
1 0 8 S 0.0 0.0 0:10 init [2]
18:01:28 up 4 days, 17:48, 1 user, load average: 36.37, 29.85, 17.13
122 processes: 108 sleeping, 12 running, 2 zombie, 0 stopped
CPU states: 59.2% user, 18.4% system, 0.7% nice, 21.8% idle
Mem: 1033616K total, 1022480K used, 11136K free, 13528K buffers
Swap: 999920K total, 999920K used, 0K free, 11144K cached
PID UID PRI STAT %CPU %MEM TIME COMMAND
2 0 9 SW 99.9 0.0 0:02 keventd
5 0 20 RW 99.9 0.0 15:10 kswapd
197 0 9 S 99.9 0.0 0:09 /sbin/klogd
393 0 6 R 99.9 0.0 0:10 /usr/sbin/cron
26396 65534 9 R 99.9 1.5 1524m /usr/bin/perl /usr/bin/mhonarc /home/his/
24144 0 9 S 99.9 0.1 0:13 /usr/sbin/named
14477 0 15 R N 99.9 0.0 46:00 integrit -C /etc/integrit/integrit.conf -c
16651 33 9 D 99.9 0.1 0:12 /usr/sbin/apache
18217 33 9 D 99.9 0.1 0:11 /usr/sbin/apache
20436 33 9 D 99.9 0.1 0:14 /usr/sbin/apache
22449 33 8 D 99.9 0.1 0:18 /usr/sbin/apache



そして5分後には元に戻っている。


18:05:02 up 4 days, 17:52, 1 user, load average: 10.23, 22.72, 17.16
105 processes: 100 sleeping, 4 running, 1 zombie, 0 stopped
CPU states: 59.1% user, 18.4% system, 0.7% nice, 21.8% idle
Mem: 1033616K total, 275068K used, 758548K free, 66640K buffers
Swap: 999920K total, 471280K used, 528640K free, 76756K cached
PID UID PRI STAT %CPU %MEM TIME COMMAND
5916 1004 8 R 24.3 0.3 0:00 /usr/bin/perl /usr/bin/mhonarc /home/ml/ju
5918 0 15 D 16.8 0.2 0:00 /usr/local/bin/perl /usr/local/bin/ftpmirr
5904 1005 11 R 12.1 0.2 0:00 /usr/local/bin/perl /home/luka/fml/msend.p
5917 1000 13 R 3.7 0.0 0:00 /usr/bin/top -n1 -b
11 0 9 SW 0.9 0.0 15:22 kjournald
5856 0 9 D 0.9 0.0 0:00 find / /boot /boot.bak /usr /boot.old /hom
1 0 8 S 0.0 0.0 0:10 init [2]
2 0 9 SW 0.0 0.0 0:03 keventd
3 0 19 SWN 0.0 0.0 0:02 ksoftirqd_CPU0
4 0 19 SWN 0.0 0.0 0:00 ksoftirqd_CPU1
5 0 9 SW 0.0 0.0 15:19 kswapd



毎時0分に動いているバッチが臭い。

17:00に動いているMLへの新着メールのrssでの情報提供(その4)のバッチのログをみるとlinux-kernel MLへの投稿が650通以上届いていたことがわかった。

これが、非力なサーバにとっては大量のrss作成となって滞留していたのではないかなぁと言う感じ。



とりあえず、MLへの新着メールのrssでの情報提供(その4)のttrss-multi.plのwhileループの中にsleep 1;を入れてゆっくり取得するようにしてみた。

これで良くなるかなぁ。


0 件のコメント:

コメントを投稿