[Bloat] using tcp_notsent_lowat in various apps?

Dave Taht dave.taht at gmail.com
Tue Jun 16 12:11:08 EDT 2015


In light of apple's: https://developer.apple.com/videos/wwdc/2015/?id=719

I am curious if anyone has tried this new socket option in appropriate apps,
(web browsers, screen sharers like tightvnc, X11, etc)? Would it be
helpful in openssh/dropbear?

What other sorts of apps? It looks like using it in chrome got stuck
on battery life analsysis:
https://code.google.com/p/chromium/issues/detail?id=310927

It does not appear to be a define in my fairly recently version of
gcc, and looking at the kernel for linux it looks like "25" is correct
there. it is defined to be 0x201 in OSX/ios:
http://fxr.watson.org/fxr/source/bsd/netinet/tcp.h?v=xnu-2050.18.24#L217

 (and now on universally in dev builds of ios)


I just tossed off a quick patch for rsync, not that I have a clue as
to whether it would make any difference there.

diff --git a/socket.c b/socket.c
index 3f5786b..bbb2461 100644
--- a/socket.c
+++ b/socket.c
@@ -406,6 +406,8 @@ static int *open_socket_in(int type, int port,
const char *bind_addr,
                           int af_hint)
 {
        int one = 1;
+       const int lowat = 16 * 1024;
+       int rc;
        int s, *socks, maxs, i, ecnt;
        struct addrinfo hints, *all_ai, *resp;
        char portbuf[10], **errmsgs;
@@ -451,6 +453,12 @@ static int *open_socket_in(int type, int port,
const char *bind_addr,

                setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
                           (char *)&one, sizeof one);
+#ifndef TCP_NOTSENT_LOWAT
+#define TCP_NOTSENT_LOWAT 25
+#endif
+               rc = setsockopt(s, IPPROTO_TCP, TCP_NOTSENT_LOWAT,
+                          (char *)&lowat, sizeof lowat);
+               if(rc != 0) { perror("lowatfailed"); }
                if (sockopts)
                        set_socket_options(s, sockopts);
                else



-- 
Dave Täht
What will it take to vastly improve wifi for everyone?
https://plus.google.com/u/0/explore/makewififast



More information about the Bloat mailing list