¸ü¶à Ñ¡ÔñÓïÑÔ
< ·µ»ØÖ÷²Ëµ¥
pcÅä¾° phÅä¾°

³£¼ûÎÊÌâ

ÄúÄ¿½ñËùÔÚλÖãºÊ×Ò³ > Ö§³ÖÏÂÔØ > ×ÔÖúЧÀÍ > ³£¼ûÎÊÌâ > Ð§ÀÍÆ÷

linuxϵͳÔËÐÐÖб¬·¢D½ø³Ì

Ðû²¼Ê±¼ä£º 2019Äê12ÔÂ17ÈÕ

ÎÊÌâÃèÊö

https://access.redhat.com/solutions/31453

https://access.redhat.com/zh_CN/solutions/695633

ϵͳ±äΪÎÞÏìӦ״̬²¢±¬·¢ÒÔÏÂÐÅÏ¢ "INFO: task <process>:<pid> blocked for more than 120 seconds".

Solution ÒÑÑéÖ¤ - ÒѸüР2018ÄêÈýÔÂ20ÈÕ07:56 - 
ÖÐÎÄ (Öйú)

Çé¿ö

²  Red Hat Enterprise Linux (RHEL) 5.5 (kernel-2.6.18-194) »ò¸ü¸ß°æ±¾

²  Red Hat Enterprise Linux (RHEL) 6

²  Red Hat Enterprise Linux (RHEL) 7

²  ½ø³Ì´¦ÓÚÎÞ·¨ÖжϵÄ˯Ãß״̬ (D state)

ÎÊÌâ

²  ÔÚϵͳ±äΪÎÞÏìӦǰ£¬/var/log/messages ÖмͼÁËÒÔÏÂÐÅÏ¢£º

Raw

INFO: task <process>:<pid> blocked for more than 120 seconds

²  ÊÇʲôԭÒòµ¼Ö±¬·¢ÉÏÃæµÄÐÅÏ¢£¿ÔÚ¶ÔÕâ¸öÎÊÌâ½øÐйÊÕÏÅųýʱÐèҪʲôÐÅÏ¢£¿

¾öÒé

  • ÕâЩÐÅϢͨ³£Òâζ×Å£¬ÏµÍ³±£´æ´ÅÅÌ»òÄÚ´æ×èÈûÎÊÌ⣬½ø³ÌÎÞ·¨»ñµÃ¿ÉÓõÄ×ÊÔ´¡£
  • Çë²ÎÔÄ "How do I use hung task check?" ÖÐ CAUTIONS Ò»¶ÎµÄÄÚÈÝ¡£
  • ÕâЩÐÅϢͨ³£ÓÃÀ´ÌáʾÓû§×¢ÒâÓë²Ù×÷ÓÅ»¯ÓйصÄÎÊÌâ¡£ÕâЩÐÅÏ¢²¢·×Æ綨´ú±í·ºÆðÁËÑÏÖصÄÎÊÌ⣬¶ø±»×èÈûµÄ½ø³Ìͨ³£»áÔÚϵͳ»Ö¸´Õý³£×´Ì¬Ê±±»´¦Àí¡£
  • Èç¹ûÐèÒª½øÒ»²½µÄ¹ÊÕÏÕï¶Ï£¬Æ¾¾Ý How do I use hung task check in RHEL ? µÄÄÚÈݱ¬·¢Ò»¸ö vmcore£¬²¢ºÍºìñµÄ¼¼ÊõÖ§³ÖÒ»ÆðÏàÖúÆÊÎö vmcore¡£
  • Èç¹û´¦ÓÚ¹ÒÆð״̬µÄÈÎÎñÊǵÚÈý·½µÄÓ¦ÓóÌÐò£¬ÇëͬʱÇëÇóÏà¹ØÓ¦ÓóÌÐò³§É̵ÄÖ§³Ö¡£
  • Èç¹ûÄúÒÑÁ˽⵽ÕâЩÈÎÎñ¹ÒÆðÐÅÏ¢ÊÇÒòΪÌض¨¹ýʧÔì³ÉµÄ£¬ÄúÒ²¿ÉÒÔ½ûÖ¹±¬·¢ÕâЩÐÅÏ¢¡£¿ÉÊÇ£¬ÎÒÃDz¢²»½¨ÒéÕâÑù×ö£¬ÕâÒ²²»¿ÉÄܱÜÃâÈÎÎñ¹ÒÆðÎÊÌâµÄ·ºÆð¡£Èç¹ûÄúÐèÒª½ûÖ¹±¬·¢ÕâЩÐÅÏ¢£¬Çë½øÐÐÒÔϲÙ×÷£º
# sysctl kernel.hung_task_timeout_secs=0
  • Èç¹ûÈÎÎñ¹ÒÆðµ¼ÖÂϵͳÍ߽⣬²¢ÇÒÄúÒÑÖªµÀÁËÔì³ÉÕâ¸öÎÊÌâµÄÔ­Òò£¬Ôò¿ÉÒÔͨ¹ý°ÑÒÔÏÂÄÚÈÝÌí¼Óµ½ /etc/sysctl.conf ÖÐÀ´ÖÆֹϵͳÍ߽⡣ÔÚ½øÐиıäºó£¬ÐèÒªÔËÐÐ 'sysctl -p' ÒÔʹ¸Ä±äÉúЧ¡£

Raw

kernel.hung_task_panic = 0

ȪԴ

  • Red Hat Enterprise Linux 5.5 ʹÓõÄÄں˰汾 2.6.18-194 ÖÐÔö¼ÓÁËÒ»¸ö Detect Hung Task ÄÚºËÏß³Ì (khungtaskd)£¬ËüµÄ¹¦Ð§ÊǼì²âµ½ÄÇЩÒÑ´¦ÓÚ D-state ( Uninterruptible Sleep (UN) ) ״̬Áè¼ÝÁËһ׼ʱ¼ä£¨Ä¬ÈÏÊÇ 120 Ã룩µÄÈÎÎñ£¬²¢°ÑÒÔÏÂÀàÐ͵ÄÐÅÏ¢¼Í¼µ½ÏµÍ³ÈÕÖ¾ÎļþÖУ¨ÀýÈ磬/var/log/messages£©¡£

Raw

"INFO: task <process>:<pid> blocked for more than 120 seconds"
  • khungtaskd ÄÚºËÏ̻߳á¼à¿Ø½ø³ÌµÄ״̬£¬²¢¼ì²éÊÇ·ñÓнø³ÌÒÑ´¦ÓÚ²»¿ÉÖжϵÄ״̬Áè¼ÝÁË "kernel.hung_task_timeout_secs" sysctl ²ÎÊýËùÉ趨µÄʱ¼ä³¤¶È£¨Õâ¸öϵͳ²ÎÊýµÄĬÈÏÖµÊÇ 120 Ã룩¡£Èç¹û±£´æÕâÑùµÄ½ø³Ì£¬Ëü»áÔÚÈÕÖ¾ÖмͼÕâ¸öÇé¿ö£¬²¢¼Í¼ÏÂ×èÈû½ø³ÌµÄŲÓûØËÝÐÅÏ¢¡£ÎªÁ˱ÜÃⱬ·¢´ó×ÚµÄÈÕÖ¾Êý¾Ý£¬ÔÚĬÈÏÇé¿öÏ£¬Õâ¸ö¼à¿Ø½ø³ÌÖ»»á±¨¸æ¼ì²âµ½µÄ×îÏȱ¬·¢µÄ 10 ¸ö¹ÒÆðÈÎÎñ£¬ÒԺ󽫲»ÔÙ±¨¸æ¡£Òò´Ë£¬×ÝÈ»²»ÔÙ±¬·¢Ïà¹ØµÄÐÅÏ¢£¬ÈÔÈ»ÓпÉÄܱ£´æ×èÈûµÄÈÎÎñ¡£
  • ¼ì²éÓëÒÔÏÂÀàËƵÄÐÅÏ¢£º

Õï¶Ï°ì·¨

Raw

INFO: task syslogd:2643 blocked for more than 120 seconds.  
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.  
syslogd D ffff81000237eaa0 0 2643 1 2646 2634  

(NOTLB)  

ffff8101352c3d88 0000000000000086 ffff8101352c3d98 ffffffff80063ff8  
0000000000001000 0000000000000009 ffff81013d2c57e0 ffff810102ac1820  
0000340b30708992 0000000000000571 ffff81013d2c59c8 000000010000089f  
Call Trace:  
[<ffffffff80063ff8>] thread_return+0x62/0xfe  
[<ffffffff88036d8a>] :jbd:log_wait_commit+0xa3/0xf5  
[<ffffffff800a1ba4>] autoremove_wake_function+0x0/0x2e  
[<ffffffff8803178a>] :jbd:journal_stop+0x1cf/0x1ff  
[<ffffffff8002ff40>] __writeback_single_inode+0x1e9/0x328  
[<ffffffff800e1464>] do_readv_writev+0x26e/0x291  
[<ffffffff800f3d9d>] sync_inode+0x24/0x33  
[<ffffffff8804c36d>] :ext3:ext3_sync_file+0xc9/0xdc  
[<ffffffff8005073a>] do_fsync+0x52/0xa4  
[<ffffffff800e1ce9>] __do_fsync+0x23/0x36  
[<ffffffff8005e28d>] tracesys+0xd5/0xe0
  • ÔÚ±¬·¢ÎÊÌâʱ»ñÈ¡ÒÔÏÂÊý¾Ý£º

Raw

# uname -a > /tmp/uname.out
# ifconfig > /tmp/ifcongfig.out
# top -n 5 -b > /tmp/top.out
# vmstat 1 50 > /tmp/vm.out
# iostat -x 2 10 > /tmp/io.out
# ps aux > /tmp/ps.out
# ps auxH > /tmp/psh.out
# sar -A > /tmp/sar.out
# free > /tmp/free.out
# lsof > /tmp/lsof.out

ÔËÐÐÒÔÏÂÃüÁîÒÔÌṩÏà¹ØµÄÊý¾Ý£º
Raw

# tar -cjvf outputs.tar.bz2 /tmp/*.out
# tar -cjvf message.tar.bz2 /var/log/message*
  • ¼ì²éÕâ¸öÎÊÌâÊÇ·ñÊÇÒòΪʹÓÃÔ¶³ÌÎļþϵͳ£¨Èç NFS£©Ôì³É´¦ÀíÑÓ³Ù¡£ÀýÈ磬Èç¹ûÓдó×Ú NFS ЧÀÍÆ÷ÇëÇ󣬾ͿÉÄÜ»áÔì³ÉÕâ¸öÎÊÌâ¡£


Raw

$ grep MYAPP lsof | grep oracle
MYAPP    7096     1062  cwd    DIR    0,18     0     558301 /oracle/prd/fs_ne/inst/conc/log
...
$ grep nfs mount
remotehost@:/ on /oracle/prd/fs_ne/inst type nfs (rw,nosuid)

ÔÚ
Ïß
¿Í
·þ
?
Áª
ϵ
ÎÒ
ÃÇ
¡Á
PGµç×Ó¡¤(Öйú)¹Ù·½ÍøÕ¾ ÁªÏµpgµç×Ó¹ÙÍø
ERP¡¢ÆóÒµÈí¼þ¹ºÖÃÈÈÏß
400-018-7700
ÔÆЧÀͲúÆ·ÏúÊÛÈÈÏß
400-607-6657
¼¯ÍÅ¿Í»§Í¶ËßÈÈÏß
400-691-8711
ÖÇÄÜÖն˲úÆ·¿Í·þÈÈÏß
400-658-6111
ÍøÕ¾µØͼ