tweak your tcp settings HELLYEAH TWEAK 'EM!

endian

Dis Member
if you have a broadband connection, your tcp settings probably aren't set up optimally. you can change them from the command line using sysctl

sysctl -A lists all the settings as java/defaults style package names.

the ones you want to change are

net.inet.tcp.sendspace: 32768
net.inet.tcp.recvspace: 32768
kern.ipc.maxsockbuf: 262144

change them by saying sudo sysctl -w net.inet.tcp.sendspace=65535 (or whatever you want to change it to.) Obviously, substitute the different variable names.



i changed my tcp.sendspace & recvspace to 65535, and my maxsockbuf size to 524288 and have noticed about a 3-500 kbps improvement in my connection speed as reported on dslreports.com and http://computingcentral.msn.com/internet/speedtest.asp

there's a windoze-oriented page on this at http://www.dslreports.com/tweaks

you *can* go too far and wind up slowing yourself down, but if that happens, just set things back the way they were & no harm done.
 

endian

Dis Member
hmm... changes don't appear to be preserved across logins though.. must have to be changed in netinfo
 

endian

Dis Member
hm.... there *is* a /etc/sysctl.conf but it doesnt work... maybe in those SystemStarter scripts?
 

endian

Dis Member
I found out that /etc/sysctl.conf was a linuxism, and bsd used rc.sysctl. But that didn't work either, then i found out it *was* in one of the SystemStartup scripts, namely /System/Library/StartupItems/Network

To make the sysctl changes persistent, just add the sysctl -w commands to that file in an appropriate place. I added mine right after it checks for the hostid, just before it closes the NETWORKUP if block.

Of course, you'll need to be root to do any of this.

Now I'm going to bed. 'nite.
 

Matrix Agent

Masochist Mascot
Endian, I think you are the first person in human history who can carry an intelligent conversation with themsevles. :p

Anyway... good work with the connection stuff. How did you figure it out?
 

endian

Dis Member
heh when caffeinated at 3am i'm capable of anything ;)

I just basically found out about the sysctl command from one of those links, and man sysctl told me that sysctl -A would get a list of what was there to change, and sysctl -w would change it. I changed them, then I restarted, and everything got set back to defaults. I did a google search for 'sysctl' and found the *nix startup files that it reads from. When they didn't work I remembered that OSX moves a lot of that stuff into either NetInfo or the SystemStarter scripts, and some more digging around found it.

One more thing to change, if you're using a switch rather than a hub, or you're the only box on your ethernet is net.inet.tcp.delayed_ack=0 That turns off delayed acks which are a waste of time if you have a switch.

This really isn't a litle niggling improvement - I've about doubled my speed!
 

.dev.lqd

Angry Member
I'll have to play with these settings. Earlier this year I was pushing 8-9MB/second (megabytes, NOT megabits) to a Win2k box on floor... these were 700MB files, not little 2k text files.

Since 100Megabit Ethernet's theoretical peak is about 12.5 megabytes per second... and most times the theoretical peak is way above a more realistic peak... I'm very interested to see what these tweaks will do. I really want another mac to do some try some gigabit stuff.

-stephen
 

.dev.lqd

Angry Member
I played around a little, and while FTPing a 45MB file back and forth between my machine and our Sun machine on the other side of campus, I saw an average of 5-10 percent increase. I'm going to play around a little longer and see how some further mods affect it...
 
Top