7 Days, 15 Terabytes and 1 Kernel Bug Later was the headline of a post back in March this year in which I described how I was chasing a problem with file read and write performance that got worse the more RAM I put into my notebook. With 16 GB of RAM, file write speeds deteriorated after only a few gigabytes and I finally chased down the issue to a kernel bug. Fortunately, after upgrading from Ubuntu 14.04 with a 32-bit 3.13 kernel to Ubuntu 16.04 with a 64-bit 4.4 kernel the problem went away. In addition, file read and write behavior has changed completely
The screenshot on the left shows how data is read from my notebook’s SSD and written to an external 3.5″ 4 TB hard drive connected via USB3. By itself it looks quite normal, with a breathtaking write speed of 182 MB/s over USB3 to the hard drive. But compared to the same screenshot from back in March there are two interesting differences while all hardware used then and now was exactly the same.
Previously, reading from the SSD and writing to the hard disk over USB3 was done at the same speed. Now, RAM buffering is used in a completely different way. Instead of reading at the same speed, the system reads several gigabytes of data from the SSD at maximum speed, buffers it it RAM and then writes it to the hard disk at a constant but much slower speed.
The second difference is the use of the CPU. Again, instead of a constant load, there are load peaks when data is read from the SSD and buffered but almost no CPU load while data is being written. As the data is encrypted on the SSD and also on the hard disk, decryption and encryption of the data is done while it is read and buffered in memory. Writing the data takes almost no processor capacity at all.
In other words, data caching must have significantly changed from the 3.18 Linux kernel used in Ubuntu 14.04 to the 4.4 Linux kernel now used in Ubuntu 16.04. Perhaps it might also be due to the change from a 32-bit to a 64-bit kernel but the only way to find out would be to Install Ubuntu 16.04 with a 32-bit kernel. And I don’t think I really want to go there… It’s fixed, it works, I’ll close my case.