To improve Samba performace under OSX, run the following command(s) in a terminal session:
sudo su
echo “net.inet.tcp.delayed_ack=0” 1>>/etc/sysctl.conf
This will add the “net.inet.tcp.delayed_ack=0” directive to the /etc/sysctl.conf config file. By default sysctl.conf does not exist, in which case it will be created.
Background from FreeBSD’s tuning man page:
The net.inet.tcp.delayed_ack TCP feature is largly misunderstood. Historically speaking this feature was designed to allow the acknowledgement to transmitted data to be returned along with the response. For example, when you type over a remote shell the acknowledgement to the character you send can be returned along with the data representing the echo of the character. With delayed acks turned off the acknowledgement may be sent in its own packet before the remote service has a chance to echo the data it just received. This same concept also applies to any interactive protocol (e.g. SMTP, WWW, POP3) and can cut the number of tiny packets flowing across the network in half. The FreeBSD delayed-ack implementation also follows the TCP protocol rule that at least every other packet be acknowledged even if the standard 100ms timeout has not yet passed. Normally the worst a delayed ack can do is slightly delay the teardown of a connection, or slightly delay the ramp-up of a slow-start TCP connection. While we aren’t sure we believe that the several FAQs related to packages such as SAMBA and SQUID which advise turning off delayed acks may be refering to the slow-start issue. In FreeBSD it would be more beneficial to increase the slow-start flightsize via the net.inet.tcp.slowstart_flightsize sysctl rather then disable delayed acks.