I created a persistent Debian 9 live usb. The persistence is configured with / union
. An unexpected consequence, although obvious in hindsight, is the system lags on non-cached reads:
holmes@bakerst:~$ # WRITE to disk
holmes@bakerst:~$ dd if=/dev/zero of=tempfile bs=1M count=1024; sync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.417477 s, 2.6 GB/s
holmes@bakerst:~$ # READ from buffer
holmes@bakerst:~$ dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.0907808 s, 11.8 GB/s
holmes@bakerst:~$ # Clear cache, non-cached READ speed
holmes@bakerst:~$ sudo /sbin/sysctl -w vm.drop_caches=3
vm.drop_caches = 3
holmes@bakerst:~$ dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 15.3935 s, 69.8 MB/s
There is a 169X difference between cached and non-cached read operations! What can I do, if anything, to improve performance?