From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::236]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id A3F8D21F3AD for ; Fri, 24 Apr 2015 07:34:11 -0700 (PDT) Received: by oift201 with SMTP id t201so41917062oif.3 for ; Fri, 24 Apr 2015 07:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=zuHedN+z5/wMgxfjsO3N20cKRzWSMgYokKZKoyKSVng=; b=aBOzLrMJYa/DYBxKJl2zKJtD4+li9Dt0qF6BM1dqrqSBEFPg853hZxMizXsKnspreH IKy/8OqW6V5CVLLnLT+hNHmCMJVnfZV4g172BlbAMV+SvJWc5OjgwdIYtnXwEFXYGleP Rz/yrqkKQmx/9tz1ZFRzyfo3JTkgy68sLwj1wCRIzo1VARukhM9gV/XkMYVA6DYvJl3x SWGEiw7g06YvuM96gRa3EYZ+rdM8cVWHgnbFJ0OmgX1F4FLWuUs3M4dARcTEVYObmgkz m/+GNABzd3jeEbfWRH51cTazdENLmvvpHy6sLAIryJ16M6sQYTvLGYFbYCSvCF/F4OoU O1mQ== MIME-Version: 1.0 X-Received: by 10.60.103.36 with SMTP id ft4mr4111289oeb.39.1429886047920; Fri, 24 Apr 2015 07:34:07 -0700 (PDT) Received: by 10.202.71.139 with HTTP; Fri, 24 Apr 2015 07:34:07 -0700 (PDT) In-Reply-To: <1429883441.22254.126.camel@edumazet-glaptop2.roam.corp.google.com> References: <20150422191056.9C7AC406057@ip-64-139-1-69.sjc.megapath.net> <1429736552.18561.144.camel@edumazet-glaptop2.roam.corp.google.com> <55380D28.5080100@hp.com> <1429883441.22254.126.camel@edumazet-glaptop2.roam.corp.google.com> Date: Fri, 24 Apr 2015 07:34:07 -0700 Message-ID: From: Dave Taht To: Eric Dumazet Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Hal Murray , bloat Subject: Re: [Bloat] SO_SNDBUF and SO_RCVBUF X-BeenThere: bloat@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: General list for discussing Bufferbloat List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2015 14:34:44 -0000 X-List-Received-Date: Fri, 24 Apr 2015 14:34:44 -0000 X-List-Received-Date: Fri, 24 Apr 2015 14:34:44 -0000 On Fri, Apr 24, 2015 at 6:50 AM, Eric Dumazet wrot= e: > On Thu, 2015-04-23 at 21:40 -0700, Dave Taht wrote: >> and of course, after writing the previous email, I go reading the >> original commit for this option. Yea, that is a huge increase in >> context switches... >> >> https://lwn.net/Articles/560082/ >> >> ... but totally worth it for many apps that can do something else >> while their connection congests, and totally awesome for tcp vpns, >> x11, screen sharers, etc.... > > It all depends on how many bytes are pushed by the application per > sendmsg() > > To keep the amount of unsent bytes low, the application should not issue > a large write, but it still can if it needs to for whatever reason. > > netperf -t TCP_STREAM" uses a default size of 16384 bytes per sendmsg. > > So obviously, if a wakeup is needed per sendmsg(), number of context > switches is exactly bandwidth_in_bytes_per_second / 16384 > > Normally, without this TCP_NOTSENT_LOWAT option, number of wakeups is > more like bandwidth_in_bytes_per_second / SO_SNDBUF, because kernel > wakes up the blocked task when output buffers size occupancy reached 50% > > > I think a "userspace janitors" project is needed, where we identify everything that could benefit from TCP_NOTSENT_LOWAT[1], and go patch it. I did a little of this for using IPV6_TCLASS right on a ton of applications and (for example) have some long standing patches submitted to rsync for selecting congestion control and setting IP_TOS/IPV6_TCLASS (sigh - still not accepted). Maybe GSOC? Getting, say just one college class to up and go do it, for a week or two, together, analyzing the the results as they go, would make a dent.... [1] I think userspace vpns could use an internal fq+codel algorithm, or perhaps the kernel socket read buffer could gain a socket option to present one --=20 Dave T=C3=A4ht Open Networking needs **Open Source Hardware** https://plus.google.com/u/0/+EricRaymond/posts/JqxCe2pFr67