netatalk.io

[TN#003] Slow AFP read performance

Author
Ralph Böhme
Published on
April 8, 2010

Throughout the years the have been numerous reports of problems with Netatalk where the AFP read performance is very, very bad.

Our investigations have shown that this is caused by subtle TCP/IP stack incompatibilites: OS X clients from 10.4 upwards use a TCP feature called delayed ACKing, which in some cases causes the server TCP stack stop sending because it is (wrongly) assuming the client is not yet ready to receive data.

Fortunately there is an easy workaround: by adjusting a sysctl tunable you can configure the OS X TCP stack to ACK in a more traditional way. It is easy to try out if you’re affected by this problem: as a user with administrative rights run the following commands on one affected OS X client:

$ sudo -s
Password: …enter password…
# sysctl -w net.inet.tcp.delayed_ack=2
# exit

Now check if the read performance goes up to a normal level. If it does: this way of adjusting the sysctl tunable does not survice a system reboot. In order to have it applied automatically upon system start use the following commands:

$ sudo -s
Password: …enter password…
# echo “net.inet.tcp.delayed_ack=2” > /etc/sysctl.conf
# exit

After rebooting you can check if the change got applied by:

$ sysctl net.inet.tcp.delayed_ack
2