LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-21-2016, 03:22 AM   #1
mdooligan
Member
 
Registered: Feb 2009
Location: Vancouver BC
Distribution: Mandrake10/ArchHackery/Gentoo
Posts: 179

Rep: Reputation: 22
NAS drive slows to 3.5MB/s


I have a Buffalo Linkstation 210 here, got it for a good deal, and it works pretty good.

I have to mount the shares CIFS, either that or it's AFS. It does FTP and Web access so that's pretty nice too.

FTP loses mtimes and there's no way to set them. CIFS (SMB) loses Case distinction and owner/group info.

Both of these methods gets me about 35MB/s thoughput, which is entirely adequate for my needs.

I want timestamps AND owner/group permissions, so what I did was this:

I create a giant block device on the CIFS share, and then mount it as ext4 loop device. Works awesome, but the throughput is lame.

First 100MB or so gets about 25MB/s, then after that, it slows to about 3.5MB/s. This is on multi GB VOBs.

Any idea why the horrible throughput on files > 100MB? Can I do anything about it?
 
Old 09-21-2016, 06:38 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,139

Rep: Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307
Sounds like something is backing up and your hardware drivers (or one of them) suck. 3.5MB/S is about the right speed for PIO4 disk access (from the last millennium), which means something is defaulting to a teetotally lame way of doing things.
 
Old 09-23-2016, 01:45 AM   #3
mdooligan
Member
 
Registered: Feb 2009
Location: Vancouver BC
Distribution: Mandrake10/ArchHackery/Gentoo
Posts: 179

Original Poster
Rep: Reputation: 22
Thanks for the reply.

Why after ~100MB? Some buffer on the NIC fills up at that point? The card is Intel Corporation 82566DM-2.

I added
Code:
async,data=writeback,noatime
to the ext4 options field in /etc/fstab and throughput seems to have increased to ~7.5-10MB/s. That's a huge improvement already. Tolerable even. About 1/2 the speed of writing to the CIFS partition by itself.

I'll keep fiddling with options. I don't think the fact it's mounted as loop device makes much difference. loops are fast by nature I think.
 
Old 09-23-2016, 10:21 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
As a comparison I have Synology NAS and copying a 512MB file over CIFS using rsync was about 14MB/s. Copying the same file with a ext4 loop device over CIFS was about 12MB/s. The loop device was mounted with the default options and the tested system runs CentOS 6.

All filesystem writes are over the network which is why when you lower ext4 overhead buy changing the options throughput goes up. There are two many variables to say why the difference on your system is much greater than mine. Switching to ext2 will probably get you the best results.
 
Old 09-24-2016, 04:30 AM   #5
mdooligan
Member
 
Registered: Feb 2009
Location: Vancouver BC
Distribution: Mandrake10/ArchHackery/Gentoo
Posts: 179

Original Poster
Rep: Reputation: 22
Quote:
Originally Posted by michaelk View Post
As a comparison I have Synology NAS and copying a 512MB file over CIFS using rsync was about 14MB/s. Copying the same file with a ext4 loop device over CIFS was about 12MB/s. The loop device was mounted with the default options and the tested system runs CentOS 6.

All filesystem writes are over the network which is why when you lower ext4 overhead buy changing the options throughput goes up. There are two many variables to say why the difference on your system is much greater than mine. Switching to ext2 will probably get you the best results.
I just now created an EXT2 partition to test this theory, mounted it with defaults, and throughput dropped as low as 3.9MB/s. Then I remounted it with async,noatime and it was just as bad. Copy same file to the EXT4 partition and throughput never dropped below 7.9MB/s. Looks like EXT4 with those mount options are my best choice so far.

This raises a question: I created the block file with truncate, not dd. I just now heard of fallocate (which doesn't seem to work on my system. fallocate: fallocate failed: Operation not supported). mkfs should take care of any sparseness issues, I think. I wonder if that is some cause of this throughput issue?

So I test my theory:

I create 10G block file with dd on CIFS NAS share. It gets created at about 12.5MB/s. This looks like max speed for my NAS drive, although the first ~100MB goes at 30-40MB/s, so that looks like the network buffer filling up, maybe a 128MB chip on the NIC. Created EXT2 fs on the block file, mount with async. Same procedure and I still get throughput as low as 3.9MB/s, so using truncate instead of dd saves a lot of time, and works just as well.

And, for me, EXT4 gets 2x the speed of EXT2 in this situation. Enigmas wrapped in mysteries...

And, unfortunately, I cannot log into my nice NAS drive as root and tweak a few things. I'm stuck as some dummy named "admin" who makes sure the donuts and coffee are stocked up.
 
Old 09-24-2016, 11:31 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
I tried another approach using two computers on my network. One with a GB network adapter and one with just a 100MB network adapter. A speed test between them using netcat was 11.9MB/s which is expected. Mounting a CIFS share on the 100MB adapter computer and creating a 1GB file took 11.7 MB/s. I then created a loop device with an ext4 filesystem. I mounted that and created a 512 MB file in the same manner and the results were 13.2MB/s. Doing the same thing with an ext2 filesystem the results were 17MB/s.

This test by using dd to create a file does not include the disk I/O of the client computer which might make my numbers higher then a real file transfer. Still working on why a remote loop filesystem is faster on top of CIFS...

Last edited by michaelk; 09-24-2016 at 11:41 AM.
 
Old 09-25-2016, 01:07 AM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,139

Rep: Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307Reputation: 2307
There's details that are always hidden that affect the speed, such as block size of transfer, exsft mode used,vetc. It is possible to write one byte St a time but obviously this is not the fastest way to do things
 
Old 09-25-2016, 08:47 AM   #8
mdooligan
Member
 
Registered: Feb 2009
Location: Vancouver BC
Distribution: Mandrake10/ArchHackery/Gentoo
Posts: 179

Original Poster
Rep: Reputation: 22
I think it's the NAS drive. Maybe that's why it was on sale. With FTP, most servers support the MTIME extension, but this one doesn't. If it did, I wouldn't be doing this loopback/EXT4 thing. It's feature set looks like it's trying really hard to support Apple stuff, and they forgot about other people in the process.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Access NAS drive Entropy1024 Linux - Newbie 9 10-26-2015 04:59 AM
[SOLVED] Backup onto NAS drive MikeinGrange Linux - Newbie 2 10-12-2015 11:23 AM
nas running 13.37, allow drive spin down? gobo7 Slackware 1 12-18-2012 03:47 PM
Mounting to a nas drive perfectpc Linux - Server 1 03-20-2012 05:26 AM
The 'dd' command writing to usb pen drive at only 2.5mb/s clifford227 Linux - Hardware 11 05-13-2011 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration