1

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?

1
  • Get a faster USB 3 pendrive, or maybe even a USB SSD :-)

  • You can easily improve reading from the image of the iso file (after a slow start), put all the content of the squash file system into RAM with the boot option toram, but I don't think it is easy or meaningful to do that with the content of the file/partition for persistence. See this link for more details.

The following screenshot of the grub menu of a persistent live system made by mkusb is from Ubuntu, but looks very similar for Debian. There is already a menuentry for toram.

enter image description here

  • Running from USB-C reads twice as fast (~111 Mb/s vs ~69 Mb/s) for non-cached. This seems sufficient to perceive the system as "smooth". The other speeds remain about the same. Unfortunately, the flash drive runs hot but I suppose that's a subject for another question... :) – Lorem Ipsum Feb 5 at 17:20
  • @LoremIpsum, Yes, that's a subject for another question. Some of my flash drives run hot, some don't. Typically fast drives run hotter than slow drives, and new drives run hotter than old ones. I don't know enough about the hardware to tell if it is a problem (for example at what temperature the lifetime is reduced.) – sudodus Feb 5 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.