netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Bill Fink <billfink@mindspring.com>
Cc: Stephen Hemminger <stephen.hemminger@vyatta.com>,
	Roland Dreier <rdreier@cisco.com>,
	David Miller <davem@davemloft.net>,
	aglo@citi.umich.edu, shemminger@vyatta.com,
	netdev@vger.kernel.org, rees@umich.edu, bfields@fieldses.org
Subject: Re: setsockopt()
Date: Wed, 9 Jul 2008 10:03:41 +0400	[thread overview]
Message-ID: <20080709060341.GA29743@2ka.mipt.ru> (raw)
In-Reply-To: <20080709014758.d59be0d8.billfink@mindspring.com>

On Wed, Jul 09, 2008 at 01:47:58AM -0400, Bill Fink (billfink@mindspring.com) wrote:
> Are you sure you're not thinking about tcp_mem, which is a function
> of available memory, or has this been changed in more recent kernels?
> The 2.6.22.9 Documentation/networking/ip-sysctl.txt indicates:

In 2.6.25 tcp_mem depends on amount of ram, and third tcp_wmem is
calculated based on it:

/* Set per-socket limits to no more than 1/128 the pressure threshold */
limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
max_share = min(4UL*1024*1024, limit);

sysctl_tcp_wmem[0] = SK_MEM_QUANTUM;
sysctl_tcp_wmem[1] = 16*1024;
sysctl_tcp_wmem[2] = max(64*1024, max_share);

sysctl_tcp_rmem[0] = SK_MEM_QUANTUM;
sysctl_tcp_rmem[1] = 87380;
sysctl_tcp_rmem[2] = max(87380, max_share);

> tcp_wmem - vector of 3 INTEGERs: min, default, max
> 	...
> 	max: Maximal amount of memory allowed for automatically selected
> 	send buffers for TCP socket. This value does not override
> 	net.core.wmem_max, "static" selection via SO_SNDBUF does not use this.
> 	Default: 128K

Yeah, its a bit confusing. It probably was copypasted, there is no
default, but minimum possible value.

> 
> The TCP autotuning worked great, with both tests basically achieving
> full 10-GigE line rate.  The test with the TCP autotuning actually
> did slightly better than the test where an explicitly specified 1 MB
> socket buffer was used, although this could just be within the margin
> of error of the testing.

If you will check tcp_wmem on your machine, it will likely show that
tcp_wmem[max] is far larger than 128k. It is equal to 1mb on my old
laptop with 256mb of ram, I suppose machines equipped with 10gige
network adapters usually have slightly more.

-- 
	Evgeniy Polyakov

  reply	other threads:[~2008-07-09  6:04 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-07 18:18 setsockopt() Olga Kornievskaia
2008-07-07 21:24 ` setsockopt() Stephen Hemminger
2008-07-07 21:30   ` setsockopt() Olga Kornievskaia
2008-07-07 21:33     ` setsockopt() Stephen Hemminger
2008-07-07 21:49     ` setsockopt() David Miller
2008-07-08  4:54       ` setsockopt() Evgeniy Polyakov
2008-07-08  6:02         ` setsockopt() Bill Fink
2008-07-08  6:29           ` setsockopt() Roland Dreier
2008-07-08  6:43             ` setsockopt() Evgeniy Polyakov
2008-07-08  7:03               ` setsockopt() Roland Dreier
2008-07-08 18:48             ` setsockopt() Bill Fink
2008-07-09 18:10               ` setsockopt() Roland Dreier
2008-07-09 18:34                 ` setsockopt() Evgeniy Polyakov
2008-07-10  2:50                   ` setsockopt() Bill Fink
2008-07-10 17:26                     ` setsockopt() Rick Jones
2008-07-11  0:50                       ` setsockopt() Bill Fink
2008-07-08 20:48             ` setsockopt() Stephen Hemminger
2008-07-08 22:05               ` setsockopt() Bill Fink
2008-07-09  5:25                 ` setsockopt() Evgeniy Polyakov
2008-07-09  5:47                   ` setsockopt() Bill Fink
2008-07-09  6:03                     ` Evgeniy Polyakov [this message]
2008-07-09 18:11                       ` setsockopt() J. Bruce Fields
2008-07-09 18:43                         ` setsockopt() Evgeniy Polyakov
2008-07-09 22:28                           ` setsockopt() J. Bruce Fields
2008-07-10  1:06                             ` setsockopt() Evgeniy Polyakov
2008-07-10 20:05                               ` [PATCH] Documentation: clarify tcp_{r,w}mem sysctl docs J. Bruce Fields
2008-07-10 23:50                                 ` David Miller
2008-07-08 20:12       ` setsockopt() Jim Rees
2008-07-08 21:54         ` setsockopt() John Heffner
2008-07-08 23:51           ` setsockopt() Jim Rees
2008-07-09  0:07             ` setsockopt() John Heffner
2008-07-07 22:50     ` setsockopt() Rick Jones
2008-07-07 23:00       ` setsockopt() David Miller
2008-07-07 23:27         ` setsockopt() Rick Jones
2008-07-08  1:15           ` setsockopt() Rick Jones
2008-07-08  1:48             ` setsockopt() J. Bruce Fields
2008-07-08  1:44           ` setsockopt() David Miller
2008-07-08  3:33       ` setsockopt() John Heffner
2008-07-08 18:16         ` setsockopt() Rick Jones
2008-07-08 19:10           ` setsockopt() John Heffner
     [not found]         ` <349f35ee0807090255s58fd040bne265ee117d06d397@mail.gmail.com>
2008-07-09 10:38           ` setsockopt() Jerry Chu
2008-07-07 21:32   ` setsockopt() J. Bruce Fields
2008-07-08  1:17 ` setsockopt() John Heffner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080709060341.GA29743@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=aglo@citi.umich.edu \
    --cc=bfields@fieldses.org \
    --cc=billfink@mindspring.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.com \
    --cc=rees@umich.edu \
    --cc=shemminger@vyatta.com \
    --cc=stephen.hemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).