我从12月19号就开始观察了,之前这台服务器在12月16号的时候出现过swap space被用光的情况,那次我发现是redhat 6的图形界面gnome的bug造成的。

详情:

alert日志报错

ORA-00476: Message 476 not found; No message file for product=RDBMS, facility=ORA

Mon Dec 16 02:43:23 CST 2013

PMON: terminating instance due to error 476

Termination issued to instance processes. Waiting for the processes to exit

Instance terminated by PMON, pid = 6082

手工启动数据库不久又宕机,发现交换空间剩余空间是0.

Swap:  8388600k total,  8388600k used,        0k free,  1110112k cached

一开始以为是dblink的bug,删除dblink之后不管用。

Swap: 10436592k total,  8390836k used,  2045756k free,  1098520k cached

接着怀疑是dbus-daemon进程导致的,重启发现交换空间没有发现明显的下降。

[root@oa-db init.d]# service messagebus restart

缁堟?绯荤粺娑堟伅鎬荤嚎锛[60G[纭?畾]

鍚?姩绯荤粺娑堟伅鎬荤嚎锛[60G[纭?畾]

Mem:  32995980k total, 32761124k used,   234856k free,    25892k buffers

Swap: 12484584k total, 10496460k used,  1988124k free,  2762116k cached

变化

Mem:  32995980k total, 29352348k used,  3643632k free,    29452k buffers

Swap: 12484584k total,  9942408k used,  2542176k free,  2790608k cached

找到问题根源,是gdm引起的。杀掉之后发现内存和交换空间明显下降。

[root@oa-db init.d]# killall gnome-panel

Mem:  32995980k total, 10503524k used, 22492456k free,    33568k buffers

Swap: 12484584k total,  8378924k used,  4105660k free,  3000724k cached

但是还是不对劲,为什么内存连一半都没有用到swap却用了8G呢,是哪个进程占用了这么大的swap?

cd /z_script

./swap.sh

PID=5463 - Swap used: 8528004 - (gvfsd )

Overall swap used: 8564856

发现swap主要是被gvfsd进程占用了,google发现是bug,需要升级gvfs

http://cache.baiducontent.com/c?m=9d78d513d98316f902bed2690d6782224d15d6777b978e1a2592d50a8465285c5a26b9e7302267448493263447b8492bbbad696f604360e4dd9b952aa7cbe13f2ffe2736731c914164d01aafcd5125b67ad605b7&p=9a62cb5e86cc42a51c81c7710f56&newp=9c39c802ba934eac52adc7710f0592695803ed6536d290&user=baidu&fm=sc&query=redhat+gvfsd&qid=&p1=1

先升级

rpm -Uvh gvfs-1.4.3-15.el6.x86_64.rpm --nodeps

rpm -Uvh gvfs-afc-1.4.3-15.el6.x86_64.rpm

rpm -Uvh gvfs-archive-1.4.3-15.el6.x86_64.rpm

rpm -Uvh gvfs-devel-1.4.3-15.el6.x86_64.rpm

rpm -Uvh gvfs-fuse-1.4.3-15.el6.x86_64.rpm

rpm -Uvh gvfs-gphoto2-1.4.3-15.el6.x86_64.rpm

rpm -Uvh gvfs-obexftp-1.4.3-15.el6.x86_64.rpm

rpm -Uvh gvfs-smb-1.4.3-15.el6.x86_64.rpm

再杀进程

ps -ef|grep gvfs

killall gvfs

ps -ef|grep gvfs

kill -9

内存和交换空间明显下降了

Mem:  32995980k total, 27094900k used,  5901080k free,   182208k buffers

Swap: 12484584k total,   322584k used, 12162000k free, 24322636k cached

gvfsd是Gnome下面的

gvfsd is the daemon process for GVFS, the GNOME Virtual File System (or possibly it's predecessor, GnomeVFS). It's a GNOME component that handles filesystem automounting when you're logged into the GNOME-based Ubuntu desktop. This includes devices like USB thumb drives and external HDDs, optical discs (CD/DVD), Samba or NFS or SSHFS network mounts, and other useful userspace filesystems (FUSE).

后来发现过一段时间gnome进程自动会启动起来

[root@oa-db z_script]# ps -ef|grep gdm

root     49905 41909  0 08:07 pts/0    00:00:00 grep gdm

root     68138     1  0 Dec16 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display3

root     68140 68138  0 Dec16 tty7     00:00:21 /usr/bin/Xorg :2 -br -verbose -auth /var/run/gdm/auth-for-gdm-scHyyx/database -nolisten tcp

gdm      68199     1  0 Dec16 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session

gdm      68202     1  0 Dec16 ?        00:00:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

gdm      68203 68138  0 Dec16 ?        00:00:00 /usr/bin/gnome-session --autostart=/usr/share/gdm/autostart/LoginWindow/

gdm      68213 68203  0 Dec16 ?        00:00:00 /usr/libexec/at-spi-registryd

gdm      68223     1  0 Dec16 ?        00:00:00 /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=12

gdm      68237 68203  0 Dec16 ?        00:00:00 metacity

gdm      68259     1  0 Dec16 ?        00:00:00 /usr/bin/pulseaudio --start --log-target=syslog

root     68388     1  0 Dec16 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display4

root     68390 68388  0 Dec16 tty8     00:00:20 /usr/bin/Xorg :3 -br -verbose -auth /var/run/gdm/auth-for-gdm-tLQEIu/database -nolisten tcp

gdm      68431     1  0 Dec16 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session

gdm      68432     1  0 Dec16 ?        00:00:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

gdm      68433 68388  0 Dec16 ?        00:00:24 /usr/bin/gnome-session --autostart=/usr/share/gdm/autostart/LoginWindow/

gdm      68439 68433  0 Dec16 ?        00:00:00 /usr/libexec/at-spi-registryd

gdm      68444     1  0 Dec16 ?        00:00:00 /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=12

gdm      68457 68433  0 Dec16 ?        00:00:00 metacity

原来是redhat6中vnc启动时默认会启用gnome进程,redhat5.5默认启用twm

其中gnome-session是启动Gnome图形界面;startkde是启动KDE图形界面;twm是启动文本界面。三者选其一。

关闭vnc服务

service vncserver stop

chkconfig vncserver off

另外直接kill -9杀gdm的进程,杀不掉,反而越杀越多。

[root@oa-db init.d]# ps -ef|grep gdm

root      6384     1  0 Nov26 ?        00:42:52 /usr/sbin/gdm-binary

root      6414  6384  0 Nov26 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1 --force-active-vt

root      6417  6414  0 Nov26 tty1     00:45:16 /usr/bin/Xorg :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-Fy54lW/database -nolisten tcp vt1

gdm       6467     1  0 Nov26 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session

root      6958  6414  0 Nov26 ?        00:00:00 pam: gdm-password

root      7604     1  0 Nov26 ?        00:00:00 /usr/libexec/gdm-user-switch-applet --oaf-activate-iid=OAFIID:GNOME_FastUserSwitchApplet_Factory --oaf-ior-fd=40

root     67536 40872  0 08:52 pts/2    00:00:00 grep gdm

[root@oa-db init.d]# kill -9 6384

[root@oa-db init.d]# ps -ef|grep gdm

root      6414     1  0 Nov26 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1 --force-active-vt

root      6417  6414  0 Nov26 tty1     00:45:16 /usr/bin/Xorg :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-Fy54lW/database -nolisten tcp vt1

gdm       6467     1  0 Nov26 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session

root      6958  6414  0 Nov26 ?        00:00:00 pam: gdm-password

root      7604     1  0 Nov26 ?        00:00:00 /usr/libexec/gdm-user-switch-applet --oaf-activate-iid=OAFIID:GNOME_FastUserSwitchApplet_Factory --oaf-ior-fd=40

root     68105     1  1 08:52 ?        00:00:00 /usr/sbin/gdm-binary

root     68138 68105  0 08:52 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display3

root     68140 68138  1 08:52 tty7     00:00:00 /usr/bin/Xorg :2 -br -verbose -auth /var/run/gdm/auth-for-gdm-scHyyx/database -nolisten tcp

root     68146 40872  0 08:52 pts/2    00:00:00 grep gdm

[root@oa-db init.d]# kill -9 68105

[root@oa-db init.d]# ps -ef|grep gdm

root      6414     1  0 Nov26 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1 --force-active-vt

root      6417  6414  0 Nov26 tty1     00:45:16 /usr/bin/Xorg :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-Fy54lW/database -nolisten tcp vt1

gdm       6467     1  0 Nov26 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session

root      6958  6414  0 Nov26 ?        00:00:00 pam: gdm-password

root      7604     1  0 Nov26 ?        00:00:00 /usr/libexec/gdm-user-switch-applet --oaf-activate-iid=OAFIID:GNOME_FastUserSwitchApplet_Factory --oaf-ior-fd=40

root     68138     1  0 08:52 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display3

root     68140 68138 18 08:52 tty7     00:00:02 /usr/bin/Xorg :2 -br -verbose -auth /var/run/gdm/auth-for-gdm-scHyyx/database -nolisten tcp

gdm      68199     1  0 08:52 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session

gdm      68202     1  0 08:52 ?        00:00:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

gdm      68203 68138  0 08:52 ?        00:00:00 /usr/bin/gnome-session --autostart=/usr/share/gdm/autostart/LoginWindow/

gdm      68208     1  1 08:52 ?        00:00:00 /usr/libexec/gconfd-2

gdm      68213 68203  0 08:52 ?        00:00:00 /usr/libexec/at-spi-registryd

gdm      68216     1  4 08:52 ?        00:00:00 /usr/libexec/gnome-settings-daemon --gconf-prefix=/apps/gdm/simple-greeter/settings-manager-plugins

gdm      68223     1  0 08:52 ?        00:00:00 /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=12

gdm      68234     1  0 08:52 ?        00:00:00 /usr/libexec/gvfsd

gdm      68237 68203  0 08:52 ?        00:00:00 metacity

gdm      68244 68203  2 08:53 ?        00:00:00 /usr/libexec/gdm-simple-greeter

gdm      68245 68203  0 08:53 ?        00:00:00 /usr/libexec/polkit-gnome-authentication-agent-1

gdm      68246 68203  0 08:53 ?        00:00:00 gnome-power-manager

gdm      68257     1  0 08:53 ?        00:00:00 /usr/libexec/notification-daemon

gdm      68259     1  0 08:53 ?        00:00:00 /usr/bin/pulseaudio --start --log-target=syslog

root     68268 68138  0 08:53 ?        00:00:00 pam: gdm-password

root     68269 68138  0 08:53 ?        00:00:00 pam: gdm-fingerprint

root     68356     1  1 08:53 ?        00:00:00 /usr/sbin/gdm-binary

root     68388 68356  0 08:53 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display4

root     68390 68388 47 08:53 tty8     00:00:00 /usr/bin/Xorg :3 -br -verbose -auth /var/run/gdm/auth-for-gdm-tLQEIu/database -nolisten tcp

root     68408 40872  0 08:53 pts/2    00:00:00 grep gdm

[root@oa-db init.d]# kill -9 68356

[root@oa-db init.d]# ps -ef|grep gdm

root      6414     1  0 Nov26 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1 --force-active-vt

root      6417  6414  0 Nov26 tty1     00:45:16 /usr/bin/Xorg :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-Fy54lW/database -nolisten tcp vt1

gdm       6467     1  0 Nov26 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session

root      6958  6414  0 Nov26 ?        00:00:00 pam: gdm-password

root      7604     1  0 Nov26 ?        00:00:00 /usr/libexec/gdm-user-switch-applet --oaf-activate-iid=OAFIID:GNOME_FastUserSwitchApplet_Factory --oaf-ior-fd=40

root     68138     1  0 08:52 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display3

root     68140 68138  9 08:52 tty7     00:00:02 /usr/bin/Xorg :2 -br -verbose -auth /var/run/gdm/auth-for-gdm-scHyyx/database -nolisten tcp

gdm      68199     1  0 08:52 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session

gdm      68202     1  0 08:52 ?        00:00:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

gdm      68203 68138  0 08:52 ?        00:00:00 /usr/bin/gnome-session --autostart=/usr/share/gdm/autostart/LoginWindow/

gdm      68208     1  0 08:52 ?        00:00:00 /usr/libexec/gconfd-2

gdm      68213 68203  0 08:52 ?        00:00:00 /usr/libexec/at-spi-registryd

gdm      68216     1  1 08:52 ?        00:00:00 /usr/libexec/gnome-settings-daemon --gconf-prefix=/apps/gdm/simple-greeter/settings-manager-plugins

gdm      68223     1  0 08:52 ?        00:00:00 /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=12

gdm      68234     1  0 08:52 ?        00:00:00 /usr/libexec/gvfsd

gdm      68237 68203  0 08:52 ?        00:00:00 metacity

gdm      68244 68203  1 08:53 ?        00:00:00 /usr/libexec/gdm-simple-greeter

gdm      68245 68203  0 08:53 ?        00:00:00 /usr/libexec/polkit-gnome-authentication-agent-1

gdm      68246 68203  0 08:53 ?        00:00:00 gnome-power-manager

gdm      68257     1  0 08:53 ?        00:00:00 /usr/libexec/notification-daemon

gdm      68259     1  0 08:53 ?        00:00:00 /usr/bin/pulseaudio --start --log-target=syslog

root     68268 68138  0 08:53 ?        00:00:00 pam: gdm-password

root     68269 68138  0 08:53 ?        00:00:00 pam: gdm-fingerprint

root     68388     1  0 08:53 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display4

root     68390 68388 17 08:53 tty8     00:00:03 /usr/bin/Xorg :3 -br -verbose -auth /var/run/gdm/auth-for-gdm-tLQEIu/database -nolisten tcp

gdm      68431     1  0 08:53 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session

gdm      68432     1  0 08:53 ?        00:00:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

gdm      68433 68388  0 08:53 ?        00:00:00 /usr/bin/gnome-session --autostart=/usr/share/gdm/autostart/LoginWindow/

gdm      68436     1  0 08:53 ?        00:00:00 /usr/libexec/gconfd-2

gdm      68439 68433  0 08:53 ?        00:00:00 /usr/libexec/at-spi-registryd

gdm      68442     1  3 08:53 ?        00:00:00 /usr/libexec/gnome-settings-daemon --gconf-prefix=/apps/gdm/simple-greeter/settings-manager-plugins

gdm      68444     1  0 08:53 ?        00:00:00 /usr/libexec/bonobo-activation-server --ac-activate --ior-output-fd=12

gdm      68454     1  0 08:53 ?        00:00:00 /usr/libexec/gvfsd

gdm      68457 68433  0 08:53 ?        00:00:00 metacity

gdm      68460 68433  1 08:53 ?        00:00:00 /usr/libexec/gdm-simple-greeter

gdm      68461 68433  0 08:53 ?        00:00:00 /usr/libexec/polkit-gnome-authentication-agent-1

gdm      68462 68433  0 08:53 ?        00:00:00 gnome-power-manager

gdm      68466     1  0 08:53 ?        00:00:00 /usr/libexec/notification-daemon

root     68470 68388  0 08:53 ?        00:00:00 pam: gdm-password

root     68471 68388  0 08:53 ?        00:00:00 pam: gdm-fingerprint

root     68616     1  1 08:53 ?        00:00:00 /usr/sbin/gdm-binary

root     68653 68616  0 08:53 ?        00:00:00 /usr/libexec/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display5

root     68655 68653 61 08:53 tty9     00:00:01 /usr/bin/Xorg :4 -br -verbose -auth /var/run/gdm/auth-for-gdm-UqFuhm/database -nolisten tcp

root     68675 40872  0 08:53 pts/2    00:00:00 grep gdm

Logo

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。

更多推荐