Previous 1 2 3 Next 68 Replies Latest reply: Apr 17, 2008 2:51 PM by mbpjunkie
Elliot Roth Level 1 Level 1 (20 points)
I did a TCP test at speedguide.net and this is what it found for my TCP stack settings:

Default TCP Receive Window (RWIN) = 524280
RWIN Scaling (RFC1323) = 3 bits (scale factor of 6)
Unscaled TCP Receive Window = 65535

This is way off normal, and changing the RWIN in terminal has no effect. It stays at 524280, which is too large except for an extremely fast connection. Nothing I could do in terminal would set the RWIN to a correct range.

I finally turned scaling off (RFC1323=0) which set my RWIN to 65535, but that is a bit low for my cable connection. There does not seem to be a way to get any other size.

Mac OS X (10.5)
  • Scott Micciche Level 1 Level 1 (130 points)
    I believe you must change the net.inet.tcp.sockthreshold, it is currently set to 256 which means that the recvspace and sendspace changes you make will have no effect until 256 socket connections have been utilized. Change this to 0 and your new recvspace and sendspace settings will work. Remember, rwin is a WINDOZE/Linux naming convention and not a Unix tcp stack naming convention.
  • Elliot Roth Level 1 Level 1 (20 points)
    Thats was the trick. It works perfectly now. my receive window is now 128940, exactly where it used to be. SPREAD THE WORD!

    PS. Terminal said that I was at 64 not 256 sockets before I made the change.
  • Scott Micciche Level 1 Level 1 (130 points)
    Good to know, apple must have changed that threshold since Tiger. My Leopard is on a UPS truck somewhere!
  • Ziv Jacoby Level 3 Level 3 (655 points)
    Hi,

    I checked my connection and it too shows 65535.

    Where do I find the parameter to change? Is it some kind of preference?

    Thank,

    Ziv
  • Scott Micciche Level 1 Level 1 (130 points)
    You'll use the terminal, located in the /Applications/utilities folder.

    Try this:

    Open the terminal
    type: sysctl -a|grep threshold

    you should see the result: net.inet.tcp.sockthreshold: 64

    If you with to change this, use this:

    sudo sysctl -w net.inet.tcp.sockthreshold=0

    You will be prompted for your password. If you want this to keep between reboots, you will need to modify the /etc/sysctl.conf file. Editing this will require the use of a Unix editor, like VI. If you need help with that, let me know, I've been a Unix sysadmin for 19 years, editing files isn't as scary as some think.
  • Ziv Jacoby Level 3 Level 3 (655 points)
    Thanks.
  • kingbloobie Level 1 Level 1 (0 points)
    I'd like to take you up on your offer, Scott. Could you please give us a step-by-step rundown on how to permanently modify the /etc/sysctl.conf file in a Unix editor? Thanks!
  • Scott Micciche Level 1 Level 1 (130 points)
    The easiest way I've found on the Mac, without having to use the unix editor Vi, but the terminal is necessary. Open the terminal application in the /Applications/Utilities folder. Enter the following:

    cd /etc <return>
    sudo open -a textedit sysctl.conf ( you will be prompted for your password)

    after entering your password, you will be in textedit, all you have to do is add this line:

    net.inet.tcp.sockthreshold=0


    File -> Save
    Textedit -> Quit

    You can verify your entry in the /etc/sysctl.conf file by typing this:

    cat /etc/sysctl.conf

    the contents will pill out onto the console, you will probably only have one line in it. If you added correctly, upon your next reboot, the setting you with to modify will take effect.

    More information can be found by typing:

    man sysctl
  • Scott Micciche Level 1 Level 1 (130 points)
    I just realized after trying textedit on another machine, that it doesn't work so it may be unreliable. This is another way:

    cd /etc <return>
    sudo pico sysctl.conf (enter your password)
    enter the line:

    net.inet.tcp.sockthreshold=0

    CTRL-X
    when prompted, enter "Y" for YES, save the file

    I tried this on 3 machines and it works on all.
  • kingbloobie Level 1 Level 1 (0 points)
    Your second way worked great! I hope this method continues to keep my internet connection running at Tiger-esque speeds after rebooting. Your first, temporary fix helped a lot. Thank you once again.

    Question: do I need to bail out of sudo before I quit Terminal? If so, how's it done?
  • effstop Level 1 Level 1 (0 points)
    Scott

    This is the first time that I have ever done anything in Terminal so please be patient with me.

    so I follow your instructions and A new window appears ( black band across top GNU nana 2.01 File sysctl.conf ) in which I type

    net.inet.tcp.sockthreshold=0

    CTRL-X

    I press return and nothing happens - Terminal does NOT prompt me to save - what am I doing wrong ?

    I am in DESPERATE need of this fix !

    Thanks for all your help and my apologies that I am totally ignorant about Terminal
  • Ziv Jacoby Level 3 Level 3 (655 points)
    All,

    I think that using vi as your editor is the best thing.

    1. Just login as su (by typing sudo su in terminal using computer admin acount).
    2. type >vi /etc/sysctl.conf (where > is your prompt no need to type it)
    3. in vi, press the letter i where you want the text to appear and type net.inet.tcp.sockthreshold=0
    4. press escape and :wq (column w q)

    if you make a mistake in vi you can always press escape and :q! to exit with no save

    In any case it is always advisable to save a copy of the original file (just in case) by typing:

    cp /etc/sysctl.conf /etc/sysctl.conf.org


    if a restore is needed one can always type

    cp /etc/sysctl.conf.org /etc/sysctl.conf


    to restore the original file

    Ziv
  • Craig Brady Level 4 Level 4 (1,790 points)
    cd /etc <return>
    sudo pico sysctl.conf (enter your password)
    enter the line:

    net.inet.tcp.sockthreshold=0

    CTRL-X
    when prompted, enter "Y" for YES, save the file

    I think you need one last "enter" key to actually save and get back to terminal
  • Scott Micciche Level 1 Level 1 (130 points)
    If you tried the "sudo" command first, you shouldn't have any trouble, if not, it may not be able to save the file due to permissions in that folder. You can try CTRL-C to quit that program and try this instead:

    cd /etc
    sudo echo "net.inet.tcp.sockthreshold=0" > sysctl.conf

    There shouldn't be a file by default on a new installation of Leopard as the initial tuning is done using different plist files.
Previous 1 2 3 Next