4

I noted my backups were very slow so I did a speed test using sysbench like this:

$ mkdir benchmark
$ cd benchmark
$ sysbench fileio prepare
$ sysbench fileio --file-test-mode=rndrw run

These are the results:

sysbench 1.0.11 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Extra file open flags: 0
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...

Threads started!


File operations:
    reads/s:                      72.23
    writes/s:                     48.16
    fsyncs/s:                     153.46

Throughput:
    read, MiB/s:                  1.13
    written, MiB/s:               0.75

General statistics:
    total time:                          10.0039s
    total number of events:              2741

Latency (ms):
         min:                                  0.03
         avg:                                  3.65
         max:                                 86.83
         95th percentile:                     12.30
         sum:                               9991.70

Threads fairness:
    events (avg/stddev):           2741.0000/0.00
    execution time (avg/stddev):   9.9917/0.00

The hard drive is a new 4tb western digital inside a Nisuta USB 3 case .

Only partition in the drive is empty and is EXT4.

Why is it so slow?

  • ...and the question here is...? – mikewhatever Nov 03 '20 at 22:05
  • The question here is, do you actually think this is normal? We are talking about a USB 3 port with a new 4tb hard drive. Is ubuntu supposed to give such a poor performance? So, another question that would emerge from the previous one, Is windows so much better? – Stephen H. Anderson Nov 04 '20 at 01:32
  • Comments are designed for US to ask YOU questions about your Question. You should Edit your question to add information. By updating your Question, and using the formatting buttons, you make all the information available to new readers. People shouldn't have to read a long series of comments to get the whole story. – waltinator Nov 04 '20 at 04:52
  • You should be able to read/write at maximum speeds over USB3 with HDDs. Try a different USB 3 cable, a bad cable is usually the most common issue with externals. Take the drive out of the enclosure and test it via SATA. Though I am confused by these results, 2G in 10 seconds, but the throughput numbers don't match that. – rtaft Nov 05 '20 at 17:58
  • Search thie site for the words "slow" and "copy" and see problems others have had. Depends upon how much you are copying, and how much memory buffers you have (when filled, copy grinds to a crawl). – ubfan1 Nov 05 '20 at 19:26
  • The drive is new as well as the external case. Any way of improving the buffers? Why do you suggest the SATA test? it should be much faster – Stephen H. Anderson Nov 05 '20 at 23:35
  • @StephenH.Anderson How are you reading this test and what values are you expecting? This test doesn't give you a solid read or write speed, and the output is similar to my internal 2TB drive. – rtaft Nov 09 '20 at 16:06
  • Also, if this is a backup drive, investigate other file systems. Some perform better under different conditions, I personally use XFS on backup drives as it tends to be a bit faster for large files. – rtaft Nov 09 '20 at 16:15
  • 1
    Im reading this: Throughput: written, MiB/s: 0.75 which is far to slow. I have connected it to my windows computer formated as NTFS and it works at 60 Megabytes per second and files (photographies) are copied much faster than in Ubuntu. So Something is wrong with ubuntu, like it was working as USB 1 or something but can't tell why. – Stephen H. Anderson Nov 19 '20 at 12:46
  • Search this site for "slow" copy" and see many suggestions to help specific problems. e.g. https://askubuntu.com/questions/995946/decrease-of-transfer-rate-when-copying-large-amount-of-data/996010#996010 – ubfan1 May 03 '22 at 15:59

1 Answers1

4

I recall seeing something about poor performance on Seagate 4TB drives on especially Linux machines. I've got one of these and it's a dog when you start copying lots of files. Been waiting for hours for it to copy about 60gb of files.

I read up on this some time after I got the drive and realized this. AFAIK the 4TB external I have sports SMR technology with a Cache to help mask the performance issues. But once you do write intensive tasks like try to copy several large files at once you get to notice a radical performance drop. I see each copy drop to 500kb/s. The total combined transfer rate between all the copies is slower than my Internet connection.

Here's a good explanation of SMR I found when I first tried figuring out what's happening:

https://blocksandfiles.com/2020/04/15/seagate-2-4-and-8tb-barracuda-and-desktop-hdd-smr/

Why SMR drives are sub-optimal for write-intensive workloads

Shingled magnetic recording gets more data to disk plates by partially overlapping write tracks, leaving the read track within them clear. Read IO speed is unaffected but data rewrites requires blocks of tracks to be read edited with the new data and rewritten as a new block. This lengthens data rewrite time substantially compared with conventionally recorded drives.

Write-intensive workloads are worse affected by SMR delays than read-intensive workloads. Therefore SMR drives are typically used for archival-type applications and not for real-time mixed or route-intensive use cases.

Caching writes to a non-shingled zone of the drive and writing them out to the shingled sectors in idle time will hide the slow rewrite speed effectively – until the cache fills when rewrite IO requests are still coming in.

The cache is then flushed and all the data written to the shingled area of the drive, causing a pause of potentially many seconds while this is done.

You may do well to look on Mac forums too. I'm also on Ubuntu but we're all in the same boat.

https://hardforum.com/threads/seagate-3tb-slow-write-speeds-drive-failing.1924143/

Codes216
  • 91
  • 6