Historic archive of defunct list bloat-devel@lists.bufferbloat.net
 help / color / mirror / Atom feed
* using tcp_notsent_lowat in various apps?
@ 2015-06-16 16:11 Dave Taht
  2015-06-19  2:47 ` Juliusz Chroboczek
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Taht @ 2015-06-16 16:11 UTC (permalink / raw)
  To: bloat-devel, bloat

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-19  7:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16 16:11 using tcp_notsent_lowat in various apps? Dave Taht
2015-06-19  2:47 ` Juliusz Chroboczek
2015-06-19  4:07   ` Jonathan Morton
2015-06-19  7:10     ` [Bloat] " Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox