echo 0 > /proc/sys/kernel/hung_task_timeout_secs disables this message

简介:

echo 0 > /proc/sys/kernel/hung_task_timeout_secs disables this message 

1735 blocked for more than 120 seconds


问题原因: 


默认情况下, Linux会最多使用40%的可用内存作为文件系统缓存。当超过这个阈值后,文件系统会把将缓存中的内存全部写入磁盘, 导致后续的IO请求都是同步的。


将缓存写入磁盘时,有一个默认120秒的超时时间。 出现上面的问题的原因是IO子系统的处理速度不够快,不能在120秒将缓存中的数据全部写入磁盘。


IO系统响应缓慢,导致越来越多的请求堆积,最终系统内存全部被占用,导致系统失去响应。 


 


解决方法:


根据应用程序情况,对vm.dirty_ratio,vm.dirty_background_ratio两个参数进行调优设置。 例如,推荐如下设置:


# sysctl -w vm.dirty_ratio=10


# sysctl -w vm.dirty_background_ratio=5


# sysctl -p


 


如果系统永久生效,修改/etc/sysctl.conf文件。加入如下两行:


#vi /etc/sysctl.conf 




vm.dirty_background_ratio = 5


vm.dirty_ratio = 10


重启系统生效。


本文转自aaa超超aaa 51CTO博客,原文链接:http://blog.51cto.com/10983441/1782411


相关文章
|
2月前
|
C语言 C++
关于DEV中collect2.exe [Error] ld returned 1 exit status的问题解决!!!
关于DEV中collect2.exe [Error] ld returned 1 exit status的问题解决!!!
|
10月前
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
197 0
|
9月前
|
数据安全/隐私保护
Do Sync Disk 0 Part 0 Failed, code=S3_F42, msg=Sync Failed after retry 5 times
Do Sync Disk 0 Part 0 Failed, code=S3_F42, msg=Sync Failed after retry 5 times
144 1
成功解决An error ocurred while starting the kernel
成功解决An error ocurred while starting the kernel
|
Linux Windows
胆战心惊-Kernel Panic -- not syncing: attempted to kill init
关闭了Redhat,重新启动,就遇到Kernel Panic -- not syncing: attempted to kill init,并有这样的提示:CPU has been disabled by guest os. Power off or resset。
1775 0
|
SQL 测试技术
The process could not read file xxx due to OS error 53
在不同地域的两个SQL Server服务器上配置了复制(Replication)用于同步数据(生产环境配置有Replication,测试环境也配有Replication),两地通过专线连接起来,这些复制(Replication)已经稳定运行了一两年了, 但是前阵子,测试环境的SQL Se...
1068 0