You are not logged in.

#1 2016-12-30 14:24:14

BlkChockr
Member
Registered: 2016-09-01
Posts: 14

[SOLVED] HDD slow with cp/pv, fast with DD

Hey,

as the title suggests, I am having problems with slow HDDs.

I set up a NAS with the following specs:

  • Asrock Q1900-ITX (4x2.0GHz)

  • 2GB So-DDR3 RAM

  • 1x320GB HDD @ 7200rpm (sda, /)

  • 1x1TB HDD @ 7200rpm (sdb, /root/test)

Everything is fine, it boots up pretty fast and SSH + SMB are running normally. Just the HDD speed it below average. At first I thought it might be SMB limiting, but then I tried copying and dd to be sure:

[root@nas ~]# dd if=/dev/zero of=/file bs=100M count=10
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 16,6542 s, 63,0 MB/s
[root@nas ~]# pv /file > /file.test
1000MiB 0:00:35 [  38MiB/s] [==================================================================================>] 100% 
[root@nas ~]# dd if=/dev/zero of=/root/test/file bs=100M count=10
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 7,30037 s, 144 MB/s
[root@nas ~]# pv /root/test/file > /root/test/file.test
1000MiB 0:00:20 [49,5MiB/s] [==================================================================================>] 100% 

cp and smb are also as slow as pv.

Am I missing something here? I saw users reporting ~100MB/s via smb with almost exactly the same setup (just another OS, such as FreeNAS).

The file systems are both ext4, the CPU and RAM are at about 10-20% while copying. I tried different SATA-Ports for both HDDs, as the MB has 2 Controllers.

But it didn't make a difference, so my question is: What could be the limiting factor in this case?

Last edited by BlkChockr (2017-01-01 14:14:15)

Offline

#2 2016-12-31 12:18:01

seth
Member
Registered: 2012-09-03
Posts: 51,298

Re: [SOLVED] HDD slow with cp/pv, fast with DD

You're aware that in the dd case you're only writing while in the cp case you're reading and writing from the same device?

Online

#3 2016-12-31 13:11:21

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 501

Re: [SOLVED] HDD slow with cp/pv, fast with DD

I average 33MB/s (110MB/s spikes, may be HDD bottleneck) when moving files from one system to another via samba4. When I started out with samba3, I was averaging 17MB/s (25MB/s spikes). My entire network is now on a gigabyte router and two gigabyte switches connected by cat6a cabling. My only bottleneck is the wifi connections to the two raspberry pi's (2.5MB/s) connected to my tv's.

I'm pretty sure my intranet is indicative of the average system speeds.

Offline

#4 2016-12-31 13:51:39

BlkChockr
Member
Registered: 2016-09-01
Posts: 14

Re: [SOLVED] HDD slow with cp/pv, fast with DD

seth wrote:

You're aware that in the dd case you're only writing while in the cp case you're reading and writing from the same device?

I wasn't aware of that. But I just ran dd again for copying:

[root@nas ~]# dd if=/root/test/file of=/root/test/file1 bs=100M count=10
10+0 Datensätze ein
10+0 Datensätze aus
1048576000 Bytes (1,0 GB, 1000 MiB) kopiert, 7,70622 s, 136 MB/s

Would this be still just writing?

Also, when using smb, it should be just writing too, shouldn't it? My PC, the NAS and the switch between them all have Gigabit-Ethernet, so they shouldn't limit to less than ~100MB/s, right?

Offline

#5 2016-12-31 14:00:13

seth
Member
Registered: 2012-09-03
Posts: 51,298

Re: [SOLVED] HDD slow with cp/pv, fast with DD

When using SMB, you're dealing with other problems than the disk speed. Or is that an smb mount (ie. you dd/cp remotely)?

Online

#6 2016-12-31 14:30:12

BlkChockr
Member
Registered: 2016-09-01
Posts: 14

Re: [SOLVED] HDD slow with cp/pv, fast with DD

No, the outputs I posted were just from the NAS' internal drives.

I noticed the 320GB-Drive, where Arch is on, is limiting a copy to the 1TB one to about 60MB/s. When using smb, will it temporarily save the data on the system/320GB HDD and then transfer it to the mount (1TB)? Or does it just write directly to the 1TB HDD?

Edit:

Just found an answer to the question for this specific post:

[root@nas ~]# dstat -tdD total,sda,sdb 60
----system---- -dsk/total----dsk/sda-----dsk/sdb--
     time     | read  writ: read   writ: read  writ
01-01 00:04:01| 956B   28M:    0  1570B: 956B   28M
01-01 00:05:01|6830B   22M:    0      0: 683B   22M

SMB doesn't cache the data on the system HDD.

Last edited by BlkChockr (2016-12-31 14:52:38)

Offline

#7 2016-12-31 21:18:43

seth
Member
Registered: 2012-09-03
Posts: 51,298

Re: [SOLVED] HDD slow with cp/pv, fast with DD

Some exotic ext4 mount parameters? Mounted atime? What if you set data=writeback? (or even disable the journal)

Online

#8 2017-01-01 14:05:44

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] HDD slow with cp/pv, fast with DD

I would be more inclined to do some tweaking of client side cifs mount options, in particular rsize and wsize, but others might be of help too.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2017-01-01 14:13:30

BlkChockr
Member
Registered: 2016-09-01
Posts: 14

Re: [SOLVED] HDD slow with cp/pv, fast with DD

I just learned that its my file-manager causing the slow transfer rates. In Thunar (XFCE) I have only ~35MB/s, while using dd to directly write to the smb mount of my NAS, I get ~110MB/s read and write. roll

Marking this as solved.

Edit:

Windows File Explorer also accomplishes 92MB/s while writing. smile

Last edited by BlkChockr (2017-01-01 14:17:00)

Offline

Board footer

Powered by FluxBB