Im using a Zyxel NAS 325 running arch with the 4.0 kernel. I noticed that file transfers have been in the 30MB/s range and I know from history that these drives are capable of much more so I decided to do some optimization of samba. Some of my findings were counter to some others, so I thought I would post what worked for me.
For starters, my network is 1 gigabit, and my win 7 PC demonstrated a file transfer to another win 7 PC of over 70MB/s accross the network. So I'm satisfied that the network hardware is up to faster speeds. The win 7 PC has an SSD drive to provide one side of the test system. I used robocopy /TEE to establish the speed of the transfers. I created a directory with 227 jpgs of 500K to 1M and a 4.6GB movie for test purposes. The transfer took about 2 1/2 minutes.
Its important to note that I'm running ext4 drives through Samba. The drive format and other network parameters impact if these options work.
So, the usual options mentioned in the optimization posts are the socket options.
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=393216 SO_SNDBUF=393216
I tried multiple sizes for the buffers, from 8192 to 512K
Lowest speed 12.2 MB/s was at 8192, fastest speed 37.9MB/s was at 393216 (384K)
at 512K the speed dropped down to below 37.
Once I set the buffer size I tested several of the other options
sendfile . with send file true I got 36.5MB/s with sendfile=false I got 38MB/s
read raw
write raw
The default is =raw, and that worked better for me.
one setting that made about a 2MB/s increase was
strict allocate = yes , on an ext4 drive this takes advantage of extents and speeds things along. on a badly fragmented ext3 the system stalled and wouldn't even start the transfer. Under normal settings when the file is transferred the sender requests space for the file, and samba normally lies to the sender and says it reserved the space, but it only reserves it as packets arrive, since this would normally be faster for most systems. With ext4, and extents large chunks can be easily reserved, so its faster to do it up front and then not worry about it..
Ultimately I ended up at about 37 MB/s. According to some online reviews of the Zyxel system with the normal firmware it should be capable of 60ish MB/s transfer rates so I'm still a little disappointed.
Tom