公司在美國托管的某台伺服器出現異常,異常現象如下:
- load average 30+ 以上
- service iptables start 無法啟動,同時大量iptable進行在背景運作(60個)

判斷過程:
- 起初認為是一個綜合性問題,因為該伺服器運作的服務較多,環境也比較複雜,通路量也非常大。
- 安裝sysstat軟體包,yum install sysstat ,發現安裝軟體過程非常順利,不太像一台load 30+應用伺服器應有的回報。後來通過iostat,mpstat,vmstat指令确實證明了load高的瓶頸不在io
- killall kill iptables程序無效。通過手工kill無法生效。目标确定在iptables上。
- 最終結果:發現/etc/sysconfig/iptables-config配置項:
# Unload modules on restart and stop
# Value: yes|no, default: yes
# This option has to be 'yes' to get to a sane state for a firewall
# restart or stop. Only set to 'no' if there are problems unloading netfilter
# modules.
IPTABLES_MODULES_UNLOAD="no"
就是這個“no”,導緻了iptables服務在重新開機和關閉,需要解除安裝相關子產品時出現異常。RadHat系列linux,如果iptables過濾子產品要生效,預設是使用netfiler子產品的。如果設定為“no”,就會導緻如上截圖所顯示 modprobe -q --iptbls_filter 産生30個鎖死程序,引起load達到30。
感慨和總結:現網子產品預設配置檔案,不敢修改啊!!!出人命的!!!