这是linux kernel的一个bug。大家对这个问题的解释也都比较一致,摘抄一段:
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.
This especially happens on systems with a lot of memory.
The problem is solved in later kernels。
翻译过来就是:一般情况下,linux会把可用内存的40%的空间作为文件系统的缓存。当缓存快满时,文件系统将缓存中的数据整体同步到磁盘中。但是系统对同步时间有最大120秒的限制。如果文件系统不能在时间限制之内完成数据同步,则会发生上述的错误。这通常发生在内存很大的系统上。系统内存大,则缓冲区大,同步数据所需要的时间就越长,超时的概率就越大。
解决办法:
sysctl -a | grep dirty
./sbin/sysctl -w vm.dirty_ratio=10
./sbin/sysctl -w vm.dirty_background_ratio=5
如果要永久修改,将如上配置项配置到/etc/sysctl.conf文件中
---------------------
作者:electrocrazy
来源:CSDN
原文:https://blog.csdn.net/electrocrazy/article/details/79377214
版权声明:本文为博主原创文章,转载请附上博文链接!
网友评论