net.inet.recvspace/spendspace defaults (was Re:sysctl modifications during install)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

net.inet.recvspace/spendspace defaults (was Re:sysctl modifications during install)

Sam Chill
On 8/24/06, Scott Radvan <[hidden email]> wrote:
> I have been installing 4.0- beta snapshots via FTP on a few machines
> (i386 and amd64) and after installation, one of the sysctl
> modifications I always make is increasing net.inet.tcp.recvspace so I
> can make full use of my 9Mbit ADSL2+ line.
During some very simple tests to a remote ftp server via my home
internet connection (~6mbit/s) I noticed that the default recvspace of
16384 is almost 50% slower than a recvspace of 65535. I have read the
FAQ's section on "Tuning networking parameters" and section 6.6.4 says
that increasing the recvspace/sendspace is only needed on "really
high-speed, high traffic links." I personally don't feel that a
6mbit/s cable line qualifies as a "real high-speed, high traffic link"
but it might have to the author when this part of the FAQ was written.
I had not, until reading Scott's comment about increasing recvspace on
a 9mbit Adsl line, thought that I might see an increase in performance
on my own line. Does it make sense to either increase the default
recvspace, or to change the documentation to indicate that users on
home connections might see a speed increase by bumping up the
recvspace?
Thanks,
Sam

Reply | Threaded
Open this post in threaded view
|

Re: net.inet.recvspace/spendspace defaults (was Re:sysctl modifications during install)

Claudio Jeker
On Sat, Aug 26, 2006 at 04:47:29PM -0400, Sam Chill wrote:

> On 8/24/06, Scott Radvan <[hidden email]> wrote:
> >I have been installing 4.0- beta snapshots via FTP on a few machines
> >(i386 and amd64) and after installation, one of the sysctl
> >modifications I always make is increasing net.inet.tcp.recvspace so I
> >can make full use of my 9Mbit ADSL2+ line.
> During some very simple tests to a remote ftp server via my home
> internet connection (~6mbit/s) I noticed that the default recvspace of
> 16384 is almost 50% slower than a recvspace of 65535. I have read the
> FAQ's section on "Tuning networking parameters" and section 6.6.4 says
> that increasing the recvspace/sendspace is only needed on "really
> high-speed, high traffic links." I personally don't feel that a
> 6mbit/s cable line qualifies as a "real high-speed, high traffic link"
> but it might have to the author when this part of the FAQ was written.
> I had not, until reading Scott's comment about increasing recvspace on
> a 9mbit Adsl line, thought that I might see an increase in performance
> on my own line. Does it make sense to either increase the default
> recvspace, or to change the documentation to indicate that users on
> home connections might see a speed increase by bumping up the
> recvspace?

sendspace and recvspace are set to 16k because it is a good compromise in
memory use and performance. Now the FAQ is a bit missleading.
sendspace and recvspace should be bumped if you have a large
bandwith delay product. A 6mbit line does roughly 600kB/s. Now a 16kB
window should be enough for approx 25ms round-trip time. This is only true
if you have one TCP stream using all your bandwidth.

Things you should consider. Bumping it higher may result in memory
shortages and less concurrent connections. Userland apps are able to raise
the send/recvspace via a setsockopt() call and should do this if
necessary. If you have multiple TCP streams running the buffer don't need
to be as big because the individual bandwidth is shared.

--
:wq Claudio