背景:
我试图在台式电脑上设置一台ubuntu机器.整个过程耗费了一整天,包括安装操作系统和软件.不过,我并没有考虑太多.
然后我尝试使用新机器完成我的工作,它比我的笔记本电脑慢得多,这很奇怪.
我做了iotop,发现解压缩包时的磁盘流量大约是1-2MB / s,这肯定是不正常的.
然后,经过数小时的研究,我发现this article描述了完全相同的问题,并提供了一个丑陋的解决方案:
We recently had a major performance issue on some systems, where disk write speed is extremely slow (~1 MB/s — where normal performance
is 150+MB/s).
…
EDIT: to solve this, either remove enough RAM, or add “mem=8G” as kernel boot parameter (e.g. in /etc/default/grub on Ubuntu — don’t
forget to run update-grub !)
我也看过这篇文章
并做到了
cat /proc/vmstat | egrep "dirty|writeback"
输出是:
nr_dirty 10
nr_writeback 0
nr_writeback_temp 0
nr_dirty_threshold 0 // and here
nr_dirty_background_threshold 0 // here
设置mem = 8g时,这些值为8223和4111.
因此,它基本上显示当系统内存大于8GB(在我的情况下为32GB)时,无论vm.dirty_background_ratio和vm.dirty_ratio设置如何(在我的情况下为5%和10%),实际脏阈值将变为0并且写缓冲区被禁用?
为什么会这样?
这是内核中还是其他地方的错误?
除了拔掉RAM或使用“mem = 8g”之外,还有解决方案吗?
更新:我正在使用32位的ubuntu 12.04运行3.13.0-53通用内核,所以这可能只发生在32位系统上.