I know I should not do it but I run some Ubuntu system from an USB flash drive, in persistent mode, and it is painfully slow.

"top" tells me it is not because of CPU, it is because of IO, ie high %wa.

I have already remove the swap, but to optimize further I need to get some clue about what are the processes that sollicit the disk so much.

So, basically, what I would like is the equivalent of "top" to display the processes with high IOWAIT much like "top" display the processes with high %CPU.

  • I wish this had a better answer. I just want a way to make top include the iowait time in its per-process cpu percentages. – bukzor Oct 28 '13 at 18:31

Many USB "pen" drives are very slow, particularly for writing, so there might be very little you can do other than to try a faster drive.

To answer your direct question: You can get some picture of what is going on disk wise with iotop -o - if left running during busy periods that will show you which processes are actively performing disk reads/writes and how much. This might highlight some process or service that you can do without and turn off to help things along. There are some crons jobs in many Linux setups that scan a chunk of the filesytsem (if not all of it/them) occasionally to update search caches (such as the updatedb task that updates the data used by commands like locate) - if you find one of those is causing your slowness then they can be safely removed from cron's list of things to regularly run.

How much RAM do you have in the target machine? If it is a small machine by that measure then this will not help as there will be little room to cache reads (so things read again a short time later need to come from the USB stick again rather than a cached copy in RAM).

You could try a cut-down version of Ubuntu too, particularly if you are in a low-RAM situation but it could also help if you have lots of RAM but slow drive(s) by reducing boot times if nothing else. lubuntu is a popular choice for this - all the usual packages are available should you need them but it installs less by default, starts less services on boot by default, and uses a lower weight desktop environment (everything other than these changes is the same arrangement, so you should find it relatively familiar even if Ubuntu is the only Linux variant you have much experience with).

| improve this answer | |
  • 2
    Thanks. Running iotop -o -d 5 (5 secs, I am not a fast reader), I noticed 3 things: 1/ jdb2, 2/ gnome-setting-daemon and 3/ chromium that together generate almost 50%wa... Why do gnome & chromium write to the disk all the time is a mystery (it's not a lot of data however, about 10K/s)? Regarding jdb2, this is my fault I believe, I unfortunately used an ext4 fs and I am looking for solutions to get back to a more appropriate ext2 for USB keys with slow writes. – JeanHuguesRobert Dec 9 '10 at 19:07
  • 2
    Kbytes/sec or writes can be a problem for flash based drives as they need to write in large blocks (so for each small write the controller may read a full block, update it, then write it). Chromium will update its disk-based cache regularly, possibly constantly if the sites you have open are performing background requests to keep info "instantly" uptodate (facebook and many similar apps do this). Using a journal-free filesystem like ext2 will improve things by removing the writes-to-journal from the situation, but it is less safe and I'm not sure how noticeable the difference will be. – David Spillett Dec 10 '10 at 15:05

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.