0

I've bought a 32 GB pen drive (SanDisk Ultra Fit 3.0). The packaging says: speed up to 150 MB/s. On my Ubuntu Linux system, raw storage device read speed (with sudo dd if=/dev/sdb of=/dev/null bs=16M) is just 51 MB/s. I don't have easy access to other operating systems to try.

What's wrong, and how do I speed it up?

Please note that the pen drive is plugged into a USB 3.0 port, which was reading an external HDD with speed 240 MB/s a few minutes before I tried it with the pen drive.

3
  • 1
    "up to" is the key phrase here. Just like broadband speeds that can be "up to" 100Mbps while in actuality it struggles to reach 5Mbps, they not technically lying when they advertise that it might theoretically reach that high a speed.
    – Mokubai
    Commented Dec 2, 2017 at 15:18
  • @Mokubai: Any advice how I could reach higher speed with this pen drive? (If I need a hardware upgrade on the computer, what should it be?)
    – pts
    Commented Dec 2, 2017 at 16:40
  • 1
    I doubt it is your computers fault. Chances are the 150MB/s is only for reads and looking at it your results seem kinda opposite to the benchmark in this review: amazon.co.uk/gp/customer-reviews/R1UBKG87XQXX3L/… Could be you just got a not very good one, or you need to write stuff to it first.
    – Mokubai
    Commented Dec 2, 2017 at 16:59

1 Answer 1

1

I think you have run into a case of difference between theoretical and practical speed. Theoretical speed is the speed of an operation/device/etc in the best case scenario. Eg. no errors happen, everything is done as planned, no external factors are taken into consideration, etc. Practical speed is the speed when all these are taken into consideration.

An easy way to spot this is the expression "up to" before the speed. Of course companies are going to advertise themselves with the way they seem to be the best, which is not practical speed.

EDIT: Flash drives are practically random-access (meaning that any data can be accessed in constant time, regardless of where it is), but are divided into blocks that are sequential (meaning that in order to read from or write to it, you need to read everything that comes before it). When data is written to or read from a block, the whole block needs to be read from/written to (when you read, the unnecessary parts are thrown away somewhere in the middle of the operation, and when you write, the same thing is written back to the unchanged parts that was there before). So in the case of a pendrive and reading, best case scenario is when every data requested alignes exactly with a block. In real life situations, this rarely happens, unless block size is taken into consideration when requesting or writing data (the user has no control over this).

Another thing to take into consideration is that behind the scenes, both the device and the OS might make error corrections when necessary, which slows down the process, but doesn't cause an error that is logged (because it was automatically corrected when detected). Without this, you might corrupt data without noticing it, so it's a necessary feature.

TL;DR: Best case scenario is basically unachievable all the time. There might be certain types of operations which go near it, tho (for example, HDDs perform far better on fewer large files than on many small ones).

EDIT2: For flash drives, I don't know what types of operations perform the best.

EDIT3: In the case of a flash drive, the size of the data read doesn't matter when testing speed. If the OS you are using reads for example 128 bytes at a time, and the device has a block size of 256 bytes, every 256 bytes needs two operations, making speed half of what it could be. However, the fact that pendrives are treated as block devices indicates that Linux can detect block size, making this cause improbable. Sorry, I can't think of any other reason that slows it down, but whatever it is, I don't think it's solvable.

6
  • Any advice on what can possibly be causing the slowness in my situation, and how I can speed it up? (No errors happen, at least I can't see any int the syslog. What can be unplanned? What are the external factors?)
    – pts
    Commented Dec 2, 2017 at 15:46
  • Any insights on what the best case scenario is, and how to reproduce it?
    – pts
    Commented Dec 2, 2017 at 15:47
  • @pts I'll edit my answer in a minute to answer those questions.
    – sisisisi
    Commented Dec 2, 2017 at 16:07
  • Thank you for more info. As indicated in the question, I'm aligning the reads to 16-megabyte boundary, which should be more then sufficient to get maximum performance. I also don't think that error correction can explain to the slowdown from 150 MB/s to 51 MB/s on a brand new pen drive. Please note that there is no file system overhead in my measurements (thus it's irrelevant how large files are), because I'm reading the block device directly. So what can be the reason for the slowness in this particular case?
    – pts
    Commented Dec 2, 2017 at 16:39
  • 1
    In the case of a flash drive, that size doesn't matter. If the OS you are using reads for example 128 bytes at a time, and the device has a block size of 256 bytes, every 256 bytes needs two operations, making speed half of what it could be. However, the fact that pendrives are treated as block devices indicates that Linux can detect block size, making this cause improbable. Sorry, I can't think of any other reason that slows it down, but whatever it is, I don't think it's solvable.
    – sisisisi
    Commented Dec 2, 2017 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .