Speed up MacOS X file transferring over network

We had an issue with a group of MacOS X clients on a particular VLAN that were experiencing painfully slow transfers (~100KB/s) to our Solaris fileservers running netatalk (AFP). The problem was solved by tweaking a kernel parameter on the client that made it “more compatible.”

delayed_ack=0 responds after every packet (OFF)
delayed_ack=1 always employs delayed ack, 6 packets can get 1 ack
delayed_ack=2 immediate ack after 2nd packet, 2 packets per ack (Compatibility Mode)
delayed_ack=3 should auto detect when to employ delayed ack, 4 packets per ack. (DEFAULT)

Get the current value for net.inet.tcp.delayed_ack (default is 3)

$ sudo sysctl -a net.inet.tcp.delayed_ack
net.inet.tcp.delayed_ack: 3

Let’s try changing it to 2 and you should immediately notice a difference (this worked for us, you may also try values of 0 and 1)

$ sudo sysctl -w net.inet.tcp.delayed_ack=2
net.inet.tcp.delayed_ack: 3 -> 2

I’m not sure why OSX ships with a default of “3.” Our software vendor also did not know, nor did our enterprise Apple support. All I do know, is that Google is filled with people experiencing the same problems as far back as ten years ago. This fix is good for all sorts of network weirdness and compatibility issues with Samba, netatalk, FreeBSD, Solaris, Windows, etc etc.

To make this persistent across reboots you will need to use /etc/sysctl.conf. If this file does not exist, create it, or use the following command.

$ echo "net.inet.tcp.delayed_ack=2" | sudo tee -a /etc/sysctl.conf

You can read more here:
TCP Performance problems caused by interaction between Nagle’s Algorithm and Delayed ACK

My Solaris ZFS Home Server

I’m gonna start this new blog off right and dedicate my first post to my new Solaris based NAS/SAN build with ZFS filesystem. Since this is a home server my goals were the usual low cost/power/noise/heat/etc. For these reasons I chose a smaller mATX server motherboard and a cost effective Core i3-530 CPU combo. This CPU, when paired with the Intel 3420 Chipset on the motherboard, makes use of the ECC memory which ZFS requires.

The 6x 750GB RAID-Z (similar to RAID5) yields 3.3TB usable space. When attached to the LSI 1068e based Dell SAS6/iR adapter that I won on eBay for $25, they write at ~140MB/s and read at ~320MB/s. This build is fully capable of saturating gigabit ethernet, both upload and download.

OSOracle Solaris 11 Express
MotherboardSupermicro X8SIL-F
CPUIntel Core i3-530
RAMKingston 4GB (2 x 2GB) SDRAM ECC Unbuffered DDR3 1333
CaseAthena Power CA-SWH01BH8
Disk AdapterDell SAS 6/iR PCI-Express x8 SAS Controller
zpool (rpool)2x (mirror) 74GB Western Digital Raptor 10000 RPM
zpool (tank)6x (RAID-Z) 750GB Seagate Barracuda ES
$ pfexec mkfile 20g /tank/speedtest &
$ zpool iostat tank 30
 capacity     operations    bandwidth
pool        alloc   free   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
tank        2.89T  1.17T     60      7  6.74M  97.4K
tank        2.90T  1.16T      1  1.28K  6.60K   138M
tank        2.90T  1.16T      0  1.33K     17   144M
tank        2.91T  1.16T      0  1.23K  10.8K   133M
tank        2.91T  1.15T      0  1.24K  2.70K   130M
$ pfexec dd if=/tank/speedtest of=/dev/null bs=16k count=1000000 &
$ zpool iostat tank 30
 capacity     operations    bandwidth
pool        alloc   free   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
tank        2.91T  1.15T     60      7  6.74M   127K
tank        2.91T  1.15T  2.23K     25   285M   123K
tank        2.91T  1.15T  2.50K      0   320M      0
tank        2.91T  1.15T  2.30K     31   295M   167K
tank        2.91T  1.15T  2.44K      0   312M      0
tank        2.91T  1.15T  2.39K     30   306M   172K