[Bloat] SO_SNDBUF and SO_RCVBUF

Dave Taht dave.taht at gmail.com
Fri Apr 24 10:34:07 EDT 2015


On Fri, Apr 24, 2015 at 6:50 AM, Eric Dumazet <eric.dumazet at gmail.com> wrote:
> 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

-- 
Dave Täht
Open Networking needs **Open Source Hardware**

https://plus.google.com/u/0/+EricRaymond/posts/JqxCe2pFr67



More information about the Bloat mailing list