Author Topic: kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message  (Read 4583 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message
« on: มิถุนายน 05, 2016, 08:00:31 PM »
ในตระกูล linux ถ้าในกรณี kernel panic เกี่ยวกับตัว hardware ของเครื่อง แล้วเจอ error message ขึ้นมาประมาณนี้

Solution for hung_task_timeout_secs
Explanation

By default Linux uses up to 40% of the available memory for file system caching. After this mark has been reached the file system flushes all outstanding data to disk causing all following IOs going synchronous. For flushing out this data to disk this there is a time limit of 120 seconds by default. In the case here the IO subsystem is not fast enough to flush the data withing 120 seconds. As IO subsystem responds slowly and more requests are served, System Memory gets filled up resulting in the above error, thus serving HTTP requests.

INFO: task jbd2/vda3-8:250 blocked for more than 120 seconds.
 Not tainted 2.6.32-431.11.2.el6.x86_64 #1
 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.

ก็ไม่ต้องตกใจนะครับ มีวิธีการแก้ไข สองวิธีก็คือ
สำหรับท่านที่ใช้งานพวก cloud ก็สามารถเข้าไปแก้ไขได้เลยง่าย คือ
1. ทำการ reboot vm นี้ก่อน
2. ทำการปรับเพิ่ม ให้ไม่ต้องแสดงการเตือน ถ้าไม่
echo 0 > /proc/sys/kernel/hung_task_timeout_secs

หรือทำการลด ค่า ratio ใน sysctl.conf จากเดิม
vm.dirty_background_ratio = 10
vm.dirty_ratio = 20
ลงครับผม
#vi /etc/sysctl.conf
ลดเป็น
vm.dirty_background_ratio = 5
vm.dirty_ratio = 10

แล้วทำการ อัฟเดท
#sysctl -p
แล้วทำการรีบูต 1 รอบ
#init 6

เรียบร้อยครับผม

reference: https://www.blackmoreops.com/2014/09/22/linux-kernel-panic-issue-fix-hung_task_timeout_secs-blocked-120-seconds-problem/