This is the website of an IT geek, technologist, freelance writer, photographer, musician, rock climber, classic mini enthusiast, iPad and Mac zealot.
You have been warned.
Nagle's Algorithm - Bad News for LAN Fileshares
In the early days of the Internet data links were slow and lots of traffic was based on single character transactions. For example, the telnet protocol sends a single byte at a time as you type. This isn't great use of the available bandwidth as the overhead of delivery is very large. An IP header is (a minimum of) 20 bytes and a TCP header is another 20 bytes. That means that to deliver one byte of data, cost a minimum of 40 bytes. That's 40:1. Not good. To make this worse, each packet will require an ACK packet to come back from the other end of the connection.
To improve this situation, an algorithm was developed to group these tiny packets into a single packet. This is know as Nagle's Algorithm after it's creator John_Nagle. The idea is to pause a number of data bytes until a sufficient number have With me so far?
This was great on WAN links and when latency was low. On a LAN however, this algorithm can actually degrade fileshare and iSCSI performance by delaying packets unnecessarily.
Here is how to disable Nagle's algorithm on Mac OS X Leopard:
sysctl -w net.inet.tcp.delayed_ack=0
This is good while the system stays up, but will be overwritten on reboot.
To set this as a permanent feature, edit /etc/sysctl.conf and add:
net.inet.tcp.delayed_ack=0
- Log in to post comments


Recent comments