Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Using a simple setup with PI as a NAS, with an attached USB disk, like this:

[RPI] (USB) -> Ethernet -> USB 2.0 Disk

Of course both network and disk access share the same USB port, but is there any way to optimize this in terms of speed? Any input is welcome!

Right now, I have something like 1400KB/S when transfering files via SFTP. Have someone made it run faster, and if so, how?

share|improve this question
    
Which OS you using? –  Alex Chamberlain Oct 21 '12 at 19:48
    
Debian (raspbian/wheezy). Pretty much default latest from raspberrypi.org –  Petter Oct 21 '12 at 21:25
1  
Just checking you were using hard float... Update your firmware. –  Alex Chamberlain Oct 21 '12 at 21:26
    
Firmware is almost certainly your first step. The newest release increased USB transfer rates dramatically. –  Jivings Oct 21 '12 at 23:38
    
Thanks!Updating software/firmware did nothing for open ssh (sftp) transfers, but for SMB it did double the speed (~3MB/s). –  Petter Oct 22 '12 at 17:48
add comment

2 Answers 2

up vote 3 down vote accepted

SFTP (SSH + FTP) is CPU intensive and the Pis CPU probably limits the bandwidth. If encrypting the data traffic is optional, consider using an unencrypted file transfer protocol like FTP. Also note that a router with NAT can prevent access to your NAS from the outside internet, so perhaps even authentication is optional. If you can trust your network's users, use a protocol that does not support authentication like TFTP. (TFTP does also not support directory listings which might be essential.) Please note that the "use of TFTP is strongly discouraged except in the most limited of circumstances where memory and CPU are at the highest premium.".

share|improve this answer
    
In this case CPU is highest premium, because it translates roughly to bandwidth. To make TFTP more viable, I build a web interface providing directory listings for a TFTP server. –  Bengt Nov 28 '12 at 1:33
add comment

The file system of the disk matters, for example writing to NTFS is known to be slow. Ext3 or 4 are faster, if changing the file system is an option. Anyway, mounting with the noatime option should improve the performance. noatime is helps with the SD-card performance too.

SFTP is cpu-heavy due to the encrypted transfer. NFS or samba are lighter. You could run 'top' on the pi while reading from or writing to the disk, to find out if the CPU usage is an issue, and which program/subsystem is the bottleneck.

I did a quick test, with SFTP from a usb hard drive with NTFS on it. Writing: 1.9 MB/s ssh and sftp took 45% of the cpu time, mount.ntfs took 40%. Reading: 3.0 MB/s, ssh and sftp took 80% ot the cpu time.

A thread about ntfs performance: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=20252&p=198958

share|improve this answer
    
In this case - IO to NTFS in Linux.. not so great. True better use Ext. Emulation NTFS is a pain in the CPU –  ppumkin Oct 23 '12 at 18:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.