View previous topic :: View next topic |
Author |
Message |
dsd Developer
![Developer Developer](/images/ranks/rank-dev.gif)
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
Posted: Fri Nov 14, 2003 3:43 pm Post subject: TCP tweaking (RWIN and the likes) |
|
|
Hi,
I've been having trouble with my connection lately, an engineer came out today to take a look. He's done some work on the hardware side but made some suggestions to how I could improve the software configuration. He didn't know linux so couldnt advise me how.
He showed me this site: http://www.speedguide.net/analyzer.php
And pointed out that my RWIN is way too low.
Code: | Default Receive Window (RWIN) = 5840
RWIN Scaling (RFC1323) = 0 bits
Unscaled Receive Window = 5840 |
He says that the windows default is usually around 64000, but he recomends registry tweaks to increase this to much much higher. On some sites I found recommended values ranging from 300000 to 800000.
Visiting the speedguide analyzer on windows, i get this output:
Code: | Default Receive Window (RWIN) = 64240
RWIN Scaling (RFC1323) = 0 bits
Unscaled Receive Window = 64240
|
A similar page: http://syntest.psc.edu:7961/ (I trust this one more because my port 80 is transparently proxied by my ISP).
Through linux:
Code: | !
! Check of SYN options
!
!=======================================================
! Variable : Val : Warning (if any)
!=======================================================
SACKEnabled : 3 :
TimestampsEnabled : 0 : WARN - Timestamps option is not enabled
CurMSS : 1460 :
WinScaleRcvd : 0 : WARN - 0 WinScale Received
CurRwinRcvd : 5840 :
!
! End of SYN options
! |
Through win2k default:
Code: | SACKEnabled : 3 :
TimestampsEnabled : 0 : WARN - Timestamps option is not enabled
CurMSS : 1460 :
WinScaleRcvd : 4294967295:
CurRwinRcvd : 64240 :
|
So basically, I'd like to increase my RWIN. I've done some googling and have come out with these commands:
Code: | echo 0 > /proc/sys/net/ipv4/tcp_timestamps
echo 1 > /proc/sys/net/ipv4/tcp_window_scaling
echo 1 > /proc/sys/net/ipv4/tcp_sack
echo "372300" > /proc/sys/net/core/rmem_default
echo "372300" > /proc/sys/net/core/rmem_max
echo "372300" > /proc/sys/net/core/wmem_default
echo "372300" > /proc/sys/net/core/wmem_max
|
However, after running those TCP analyzer pages again, my RWIN is still 5840.
Any ideas? _________________ http://dev.gentoo.org/~dsd |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Braempje l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/10911660283e9e7d2002bca.gif)
Joined: 31 Jan 2003 Posts: 748
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
neenee Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/72168911541dc0b1224415.png)
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Fri Nov 14, 2003 6:38 pm Post subject: |
|
|
i've been looking for a way to set those
options as well. with windows they seem-
ed to make a difference; maybe they
will improve something with linux as well. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dsd Developer
![Developer Developer](/images/ranks/rank-dev.gif)
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
Posted: Fri Nov 14, 2003 7:56 pm Post subject: |
|
|
Braempje wrote: | I tought there was a kernel option you had to turn on to adjust tcp window settings etc. |
any idea which one? theres quite a lot of network options, none jump out from the crowd for this functionality. _________________ http://dev.gentoo.org/~dsd |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gizmo.tar.bz23 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/3346786123fbbb4caa9b7c.jpg)
Joined: 27 Sep 2003 Posts: 81 Location: germany/stuttgart
|
Posted: Fri Nov 14, 2003 9:29 pm Post subject: |
|
|
just have a look at
/proc/sys/net/core/rmem_max _________________ hail eris, all hail discordia. [fnord] |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dsd Developer
![Developer Developer](/images/ranks/rank-dev.gif)
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
Posted: Fri Nov 14, 2003 9:59 pm Post subject: |
|
|
thanks for the reply, but i already tried that one (i set it in my series of commands from my search on google). doesnt help ![Sad :(](images/smiles/icon_sad.gif) _________________ http://dev.gentoo.org/~dsd |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dsd Developer
![Developer Developer](/images/ranks/rank-dev.gif)
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
neenee Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/72168911541dc0b1224415.png)
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Tue Nov 18, 2003 7:40 pm Post subject: |
|
|
hm. i will do a proper search across the net in a moment.
i'll report back with whatever i find. even if it is nothing.
hm.. the only thing i found was that a large receive win-
dow is only necessary when a connection is made with
a large delay (200+ms).
and i found many people asking the same thing; how to
make a setting and have it saved an used by linux. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dsd Developer
![Developer Developer](/images/ranks/rank-dev.gif)
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
Posted: Tue Nov 18, 2003 11:33 pm Post subject: |
|
|
thanks for looking.
neenee wrote: | hm.. the only thing i found was that a large receive win-
dow is only necessary when a connection is made with
a large delay (200+ms). |
that may be true, but then again, delays in data transfers can be caused by a low RWIN value. assume a situation where a remote server is sending you data: when the recieve window has been filled, the remote server will stall sending any more data until an ACK is recieved from you (the client). a small delay is introduced there (quite large delay when you got a flakey upstream like me). a larger RWIN results in less ACK'ing, fewer delays.
im usually not too bothered by these things, but a value of 5840 seems strikingly low. _________________ http://dev.gentoo.org/~dsd |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sschlueter Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 26 Jul 2002 Posts: 578 Location: Dortmund, Germany
|
Posted: Mon Nov 24, 2003 1:07 am Post subject: Re: TCP tweaking (RWIN and the likes) |
|
|
dsd wrote: |
He says that the windows default is usually around 64000, but he recomends registry tweaks to increase this to much much higher. On some sites I found recommended values ranging from 300000 to 800000.
|
5840 is just the default receive window. If net.ipv4.tcp_window_scaling is set, then the receive window is adjusted dynamically.
And btw the largest windows size is 65535. Higher values are not possible because it's stored in a 16 bit field. (rfc1323 describes the idea of an "implicit scale factor" but I'm unsure if that's implemented in Linux.)
Anyway, the problems with your network connection must have another reason. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dalu Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_emperor.gif)
Joined: 20 Jan 2003 Posts: 530
|
Posted: Wed May 12, 2004 4:35 pm Post subject: Re: TCP tweaking (RWIN and the likes) |
|
|
sschlueter wrote: | dsd wrote: |
He says that the windows default is usually around 64000, but he recomends registry tweaks to increase this to much much higher. On some sites I found recommended values ranging from 300000 to 800000.
|
5840 is just the default receive window. If net.ipv4.tcp_window_scaling is set, then the receive window is adjusted dynamically.
And btw the largest windows size is 65535. Higher values are not possible because it's stored in a 16 bit field. (rfc1323 describes the idea of an "implicit scale factor" but I'm unsure if that's implemented in Linux.)
Anyway, the problems with your network connection must have another reason. |
digging up an old thread,
this sounds good in theory, but it doesnt scale anything
Quote: |
Default Receive Window (RWIN) = 5808
RWIN Scaling (RFC1323) = 0 bits
Unscaled Receive Window = 5808
RWIN is a multiple of MSS
Other values for RWIN that might work well with your current MTU/MSS:
511104 (MSS x 44 * scale factor of
255552 (MSS x 44 * scale factor of 4)
127776 (MSS x 44 * scale factor of 2)
63888 (MSS x 44)
|
Code: |
!
! Check of SYN options
!
!=======================================================
! Variable : Val : Warning (if any)
!=======================================================
SACKEnabled : 3 :
TimestampsEnabled : 1 :
CurMSS : 1440 :
WinScaleRcvd : 0 : WARN - 0 WinScale Received
CurRwinRcvd : 5808 :
!
! End of SYN options
!
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dsd Developer
![Developer Developer](/images/ranks/rank-dev.gif)
Joined: 30 Mar 2003 Posts: 2162 Location: nr London
|
Posted: Wed May 12, 2004 5:38 pm Post subject: |
|
|
this was a looong time ago, but in the end i seem to remember finding a utility that measured RWIN over a continued transfer.
basically, the transfer starts off at 5808 and then rapidly increases. apparently the way that the linux tcp stack does it is much better than using a big fixed size.at this point i decided that the network engineer didn't really know what he was on about ![Smile :)](images/smiles/icon_smile.gif) _________________ http://dev.gentoo.org/~dsd |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
neenee Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/72168911541dc0b1224415.png)
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Wed May 12, 2004 7:30 pm Post subject: |
|
|
hurray ![Wink :wink:](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
TyroneSlothrop n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/456340896400c9190cf77e.jpg)
Joined: 27 Sep 2003 Posts: 39 Location: Franconia, Central Europe
|
Posted: Tue Jul 13, 2004 3:26 pm Post subject: |
|
|
Just some information for people finding this thread in the future...
The receive window is used for flow control. You can read about it for example in the following excerpt of "Computer Networking: A top down approach featuring the internet":
http://gaia.cs.umass.edu/kurose/transport/segment.html (Especially 3.5.6)
And here's something about congestion control:
http://gaia.cs.umass.edu/kurose/transport/congestion.html
And i think that you can be absolutely sure that it nearly never makes any sense at all to "tweak" the kernel. The people who hack it know what they are doing, and *if* there was a simple way to gain a lot of performance, it would *surely* be the default. _________________ warning: potentially offensive but true nonetheless... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
andyknownasabu Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/204683489642a073986f3f4.jpg)
Joined: 06 Feb 2003 Posts: 281 Location: Zurich, Switzerland
|
Posted: Sun Jul 18, 2004 12:13 pm Post subject: |
|
|
Some further information concerning this issue:
The following LWN article covers "window scaling" and mentions problems which arose after adding support for this feature in version 2.6.7-mmx of the linux kernel and Linus's BitKeeper tree.
Take a look - very interesting article and gentoo is also mentioned ;)
http://lwn.net/Articles/92727/ |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
hmiller68 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/13516432440c7111547383.gif)
Joined: 21 Dec 2002 Posts: 77
|
Posted: Fri Dec 10, 2004 8:19 pm Post subject: |
|
|
Sorry for dragging up an old thread but has any one gotten the RWIN to stay set after e reboot? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jbarry n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 27 May 2002 Posts: 55 Location: Panama
|
Posted: Fri Jan 23, 2009 3:16 pm Post subject: mystery solved |
|
|
For anyone searching the words RWIN or getting that "RWIN seems to be set to a very small number" advice from SpeedGuide.net TCP/IP Analyzer, there's no need to waste time on this non-issue, according to . . .
http://en.wikipedia.org/wiki/TCP_window_scale_option
Quote: | Linux kernels (from 2.6.8, August 2004) have enabled TCP Window Scaling by default. It chooses the good value of the option by default. The configuration parameters are found in the /proc filesystem, see pseudo-file /proc/sys/net/ipv4/tcp_window_scaling and its companions /proc/sys/net/ipv4/tcp_rmem and /proc/sys/net/ipv4/tcp_wmem (more information: man tcp, section sysctl). |
cat those /proc files to see what you've got. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|