Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Tweak TCP settings for possible speed increases Network
Depending on your kind of connection to the Internet, you may be able to improve your network performance under OS X by tweaking the TCP receive window size. In my case, I was downloading the OS X 10.1 Developer Tools, which consists of 19 segments, 18 of which are 10 MB in size (the last being around 7 MB). A typical segment download took me 8 minutes, but after the tweak it was cut in HALF! Needless to say this is an immense improvement, considering that I was still using the same connection. You can tweak the TCP receive window size by doing this:
%sudo sysctl -w net.inet.tcp.recvspace=40960

In this example I'm changing the size to 40960, or 40 KB. OS X defaults to 32 KB which is adequate for most connections, but since you have better knowledge of network conditions, you can make use of it to get results like I did. Experiment with other values to find the optimum.

Have fun.

    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[35,461 views]  

Tweak TCP settings for possible speed increases | 13 comments | Create New Account
Click here to return to the 'Tweak TCP settings for possible speed increases' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
problems with mozilla 0.9.5
Authored by: lemurs on Nov 02, '01 02:55:51PM

i changed to 40kb and mozilla would no longer load any pages. i could though still use netscape 4 thru classic. i switched back to 32 and everything worked fine again.



[ Reply to This | # ]
problems with mozilla 0.9.5
Authored by: palx on Nov 02, '01 03:08:04PM

Hi. I think the prob is in the number contained in the article. Infact the number listed in the tip article is too high. It means 400k and not 40k as stated by the author! I think 400k is way too much. Try with something like 65536 (wich is the double of the default value, 32768).

I've had the same problems with the value contained in the article and i think it's because is too high.:)

Hope it helps. palx.



[ Reply to This | # ]
Typo fixed
Authored by: robg on Nov 02, '01 04:44:36PM

Nice catch ... sorry I missed it when publishing the tip, but it's fixed now.

-rob.



[ Reply to This | # ]
Any other instructions I need to know?
Authored by: phillipc on Nov 02, '01 05:43:49PM

I tried this hack & my Internet connection stops working. When I reset back to 32k my connection immediately resumes working. Do I need to reboot or anything?



[ Reply to This | # ]
Sorry for the typo
Authored by: Erik Toh on Nov 02, '01 10:03:57PM

Thanks for catching the typo. If you set the TCP receive window size to be too large, your connection stops responding, but it can be fixed by setting the value back to 32KB which is 32768. You don't have to reboot.



[ Reply to This | # ]
How can I fix that value permanently?
Authored by: sungwoo on Nov 03, '01 07:23:31AM

It seems that the value is resetted as a default after every restart.
How can I fix the value permanently?
BTW, I used the value 65536, and it gives me a little improvement. ;)



[ Reply to This | # ]
Problem with Shrinkwrap image?
Authored by: sungwoo on Nov 04, '01 10:53:08AM

When I download shrinkwrap image, I couldn't open it.
After set back to the default value, download again, now I can open it.
Weird... any ideas?



[ Reply to This | # ]
Delayed Ack
Authored by: Cadre on Nov 04, '01 01:00:54AM

Another interesting change that can speed up certain transfers over a high speed local lan is to turn of delayed acks.

sysctl -w net.inet.tcp.delayed_ack=0

Delayed acks reduces the amount of bandwidth on a network, but piggy-backing ack packets on other outgoing packets. If you turn off delayed acks, you can reduce latency associated with some transfers (i.e.: some situations associated with downloading files via Windows networking).



[ Reply to This | # ]
Delayed Ack
Authored by: Ripcord on May 18, '05 10:23:47PM

Another one that's supremely useful on any network with packet drops (internet, wireless networks, etc) is

sysctl -w net.inet.tcp.newreno=1

...This turns on a much more sophisticated TCP algorithm that works very well in 10.3 and 10.4. If packets get drops it recovers much more quickly and efficiently. On many networks it's like night and day.

This is something that's been standard in BSD for many years, I have no idea why Apple doesn't enable it by default?



[ Reply to This | # ]
Developer Tools Link
Authored by: TeeGate on Nov 04, '01 09:25:22AM

You mention you were downloading the 10.1 developer tools in your post. Can you post or send me the link to that?

Guy
TeeGate@home.com



[ Reply to This | # ]
net.inet.tcp.recvspace disappeared?
Authored by: hulleye on Nov 19, '01 04:15:20AM

wondering if someone can help me with this. i currently access my local network through a router hooked up to the cable modem. the router serves both BootP and DHCP connections, and i'd initially setup to connect through a BootP server. i initially changed the tcp recieve window size succesfully using the hint above. later, i changed my network settings to connect through a DHCP server, and decided to check whether the tcp receive window size had been altered.

i was rather surprised to find that i no longer have the option to change net.inet.tcprecvspace, since it's not even listed in the sysctl man page anymore (it was there when i was connecting through the BootP server).

anyone know if you can change the tcp receive space in DHCP connections or ami just doing something stupid?



[ Reply to This | # ]
Tweak TCP settings for possible speed increases
Authored by: Heineken on Dec 12, '03 07:33:43AM


Could someone help me with this I want to know if this really work on my computer I have the iMac G4 800MHz with Comcast BoradBand Cable.



[ Reply to This | # ]
Tweak TCP settings for possible speed increases
Authored by: Heineken on Dec 14, '03 02:04:29AM

hello



[ Reply to This | # ]