{"id":956,"date":"2017-04-17T13:05:58","date_gmt":"2017-04-17T12:05:58","guid":{"rendered":"http:\/\/oktobrima.staff.fe.uns.ac.id\/?p=956"},"modified":"2021-03-02T23:20:57","modified_gmt":"2021-03-02T23:20:57","slug":"solution-for-hung_task_timeout_secs","status":"publish","type":"post","link":"https:\/\/angga.feb.uns.ac.id\/?p=956","title":{"rendered":"Solution for hung_task_timeout_secs"},"content":{"rendered":"<h2>Solution for\u00a0hung_task_timeout_secs<\/h2>\n<h2>Explanation<\/h2>\n<p>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.<\/p>\n<h2>Testing<\/h2>\n<p>I tested this theory with the following:<br \/>\nChange\u00a0<code>vm.dirty_ratio<\/code> and\u00a0<code>vm.dirty_backgroud_ratio<\/code><\/p>\n<pre>someuser@servercore [\/home\/someuser]$ sudo sysctl -w vm.dirty_ratio=10\nsomeuser@servercore [\/home\/someuser]$ sudo sysctl -w vm.dirty_background_ratio=5<\/pre>\n<p>Commit Change<\/p>\n<pre>someuser@servercore [\/home\/someuser]# sudo sysctl -p<\/pre>\n<h2>Make it\u00a0permanent<\/h2>\n<p>When the server seemed more stable and no Kernel\/Swap\/Memory Panic for a week, I edited\u00a0<code>\/etc\/sysctl.conf<\/code> file to make these permanent after reboot.<\/p>\n<pre>someuser@servercore [\/home\/someuser]$ sudo vi \/etc\/sysctl.conf<\/pre>\n<p>ADD 2 lines at the bottom<\/p>\n<pre>vm.dirty_background_ratio = 5\nvm.dirty_ratio = 10<\/pre>\n<p>Save and exit.<\/p>\n<pre>someuser@servercore [\/home\/someuser]$ sudo reboot<\/pre>\n<p>That\u2019s it. I never had this issue .. ever again..<\/p>\n<p>saduran dari\u00a0https:\/\/www.blackmoreops.com\/2014\/09\/22\/linux-kernel-panic-issue-fix-hung_task_timeout_secs-blocked-120-seconds-problem\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Solution for\u00a0hung_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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-956","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=956"}],"version-history":[{"count":1,"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=\/wp\/v2\/posts\/956\/revisions"}],"predecessor-version":[{"id":4100,"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=\/wp\/v2\/posts\/956\/revisions\/4100"}],"wp:attachment":[{"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angga.feb.uns.ac.id\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}