Skip to content
March 10, 2014 / ftth

Very slow (1MB/s) disk write performance on (Ubuntu) Linux 3.4.x-generic Linux kernel

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).

hdparm read performance was unaffected, and no obvious messages were found anywhere; after reading many online suggestions, disabling acpi or various filesystem tweaks didn’t fix anything (it seems that the issue persists whatever the hard drive model or filesystem).

In the end, it comes down to the system having more than 8 GB of RAM installed.

Note that this issue seems to be fixed in later releases (3.5.0+) and is a regression (doesn’t happen on e.g. 2.6.32); the issue being is completely silent, i hope this post will help someone.

Hardware which has the issue (we didn’t find any hardware which doesn’t):

  • Intel H55 (Intel Corporation 5 Series/3400)
  • Intel Q77 (Intel Corporation 7 Series/C210)
  • Intel Q87 (Intel Corporation 8 Series/C220)

Kernel: Linux version 3.4.82-030482-generic (apw@gomeisa) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #201402221435 SMP Sat Feb 22 19:44:42 UTC 2014 (from http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4.82-quantal/)

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 !)

To see if your system is affected, the following test should show very poor figures:

With 16 GB RAM:
dd if=/dev/zero of=test bs=512k count=20
20+0 records in
20+0 records out
10485760 bytes (10 MB) copied, 8.89589 s, 1.2 MB/s

Now with with 8 GB of RAM:
dd if=/dev/zero of=test bs=512k count=200
200+0 records in
200+0 records out
104857600 bytes (105 MB) copied, 0.473313 s, 222 MB/s

9 Comments

Leave a Comment
  1. Paul / Jun 16 2014 11:01 am

    It’s still broken on 3.14, at least on Debian.

    • Edwin Eefting / Nov 21 2014 5:30 pm

      thanks! we have been on this problem for days, testing EVERYTHING.

      found this page in a desperate attempt to search for “linux 3.4 slow write”.

      mem=8G fixes it for us. (now to find out how to fix it properly 🙂

      thanks

  2. Andre / Mar 30 2015 8:14 am

    Thank you very very much!
    This was a huge problem for us because installing an older Ubuntu Version was practically impossible with this bug.

  3. memet / Jan 24 2017 7:43 pm

    Thanks for the solution.
    The bug is still here as of 2017, with Linux kernel 4.9 (32 bit debian testing-stretch). Like you said, the write speed was about 1MB on internal hdd and as low as 150-200KB on the encrypted partition on external hdd. After adding the boot parameter, the speed became 89 mb and 6,1 MB, respectively.

  4. John Bryan / Apr 15 2018 12:44 am

    I cannot believe I have tried everything imaginable in trying to figure this out. Thank you, thank you, thank you for this! Alas, I now have 16 GB of memory in my sever I can’t use, but at least the write speed isn’t crippled. Has this been reported as a kernel bug so that I can track it and hopefully find out someday that it has been fixed?

    • ftth / Apr 15 2018 7:47 am

      I tried to report it on the kernel ml, never got any response. What kernel version are you on ?

      • John Bryan / Apr 15 2018 10:26 pm

        I am on 3.13.0-139-generic at the moment, although I’ve been chasing this on at least one prior kernel version as well. I wasn’t paying attention to the kernel version because I didn’t think it was a software problem for such a long period of time.

  5. John Bryan / Apr 17 2018 3:43 pm

    Have you seen this article? It provides a (plausible) explanation for the problem and another possible work-around.

    https://stackoverflow.com/questions/30519417/why-linux-disables-disk-write-buffer-when-system-ram-is-greater-than-8gb

    • ftth / Apr 17 2018 6:00 pm

      Very instructive, thanks, this means that the poor io performance is due to the kernel not caching writes anymore.

Leave a reply to memet Cancel reply