Skip navigation
This discussion is archived

Leopard is setting RWIN too large!!!

19921 Views 68 Replies Latest reply: Apr 17, 2008 2:51 PM by mbpjunkie RSS
1 2 3 ... 5 Previous Next
Elliot Roth Level 1 Level 1 (20 points)
Currently Being Moderated
Oct 27, 2007 4:47 PM
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 Calculating status...
    Currently Being Moderated
    Oct 28, 2007 8:31 AM (in response to Elliot Roth)
    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.
    Power Mac G5 Dual 2Ghz/iBook G4 1.42Ghz, Mac OS X (10.4.10), 4G, ATI 9800 Pro 256M
  • Scott Micciche Level 1 Level 1 (130 points)
    Currently Being Moderated
    Oct 28, 2007 9:22 AM (in response to Elliot Roth)
    Good to know, apple must have changed that threshold since Tiger. My Leopard is on a UPS truck somewhere!
    Power Mac G5 Dual 2Ghz/iBook G4 1.42Ghz, Mac OS X (10.4.10), 4G, ATI 9800 Pro 256M
  • Ziv Jacoby Calculating status...
    Currently Being Moderated
    Oct 28, 2007 9:43 AM (in response to Elliot Roth)
    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
    MacBook Pro, Mac OS X (10.4.8)
  • Scott Micciche Level 1 Level 1 (130 points)
    Currently Being Moderated
    Oct 28, 2007 10:04 AM (in response to Ziv Jacoby)
    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.
    Power Mac G5 Dual 2Ghz/iBook G4 1.42Ghz, Mac OS X (10.4.10), 4G, ATI 9800 Pro 256M
  • Ziv Jacoby Level 3 Level 3 (655 points)
    Currently Being Moderated
    Oct 28, 2007 10:16 AM (in response to Scott Micciche)
    Thanks.
    MacBook Pro, Mac OS X (10.4.8)
  • kingbloobie Calculating status...
    Currently Being Moderated
    Oct 28, 2007 8:19 PM (in response to Scott Micciche)
    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!
    15" PB G4 1.67 GHz, Mac OS X (10.5)
  • Scott Micciche Level 1 Level 1 (130 points)
    Currently Being Moderated
    Oct 28, 2007 8:54 PM (in response to kingbloobie)
    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
    MBP 2.24/PMG5 2.0/iBook G4, Mac OS X (10.4.10)
  • Scott Micciche Level 1 Level 1 (130 points)
    Currently Being Moderated
    Oct 28, 2007 9:03 PM (in response to kingbloobie)
    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.
    MBP 2.24/PMG5 2.0/iBook G4, Mac OS X (10.4.10)
  • kingbloobie Level 1 Level 1 (0 points)
    Currently Being Moderated
    Oct 28, 2007 9:26 PM (in response to Scott Micciche)
    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?
    15" PB G4 1.67 GHz, Mac OS X (10.5)
  • effstop Calculating status...
    Currently Being Moderated
    Oct 29, 2007 7:06 AM (in response to Scott Micciche)
    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)
    Currently Being Moderated
    Oct 29, 2007 7:15 AM (in response to kingbloobie)
    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
    MacBook Pro, Mac OS X (10.4.8)
  • Craig Brady Level 4 Level 4 (1,790 points)
    Currently Being Moderated
    Oct 29, 2007 7:22 AM (in response to Scott Micciche)
    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
    IMac Intel 20" , Mac Mini PPC and MacBook 2.16 ghz Black (2GB RAM), Mac OS X (10.4.10), Vista Dual Boot on the MacBook
  • Scott Micciche Level 1 Level 1 (130 points)
    Currently Being Moderated
    Oct 29, 2007 7:25 AM (in response to effstop)
    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.
    MBP 2.24/PMG5 2.0/iBook G4, Mac OS X (10.4.10)
1 2 3 ... 5 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (1)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.