[tor-bugs] #12890 [Tor]: Design and implement optimizations for socket write limits

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Dec 17 14:26:00 UTC 2014


#12890: Design and implement optimizations for socket write limits
-----------------------------+--------------------------------
     Reporter:  robgjansen   |      Owner:  robgjansen
         Type:  enhancement  |     Status:  new
     Priority:  normal       |  Milestone:  Tor: 0.2.6.x-final
    Component:  Tor          |    Version:
   Resolution:               |   Keywords:  tor-relay
Actual Points:               |  Parent ID:  #12541
       Points:               |
-----------------------------+--------------------------------

Comment (by yawning):

 Ooof.

 Replying to [comment:5 robgjansen]:
 > {{{
 > ioctl(fd, SIOCINQ, &inqlen);
 > ioctl(fd, SIOCOUTQ, &outqlen);
 > }}}

 `TIOCOUTQ`/`TIOCINQ` are more portable, the `SIOCINQ`/`SIOCOUTQ` defines
 are Linux-isms.

 > '''Get the TCP info:'''
 >
 > {{{
 > getsockopt(fd, SOL_TCP, TCP_INFO, (void *)&tcp_info, &tcp_info_length);
 > }}}

 For reference, the *BSD structure is at:
 https://svnweb.freebsd.org/base/head/sys/netinet/tcp.h?revision=246210&view=markup#l192

 For Vista and later there is `GetPerTcpConnectionEStats()`
 http://msdn.microsoft.com/en-us/library/bb485738%28VS.85%29.aspx

 Replying to [comment:7 robgjansen]:
 > Replying to [comment:6 dgoulet]:
 > Relatedly, do you know if TCP auto-tuning in the kernel is disabled when
 the buffer size is explicitly set with `setsockopt`? If not, do you know a
 socket option  to disable TCP auto-tuning for a given socket?

 Yes, it does disable auto-tuning if the app layer requests something
 explicit.

 As an aside, I'm slightly worried about a sufficiently infrequent update
 window leading to underutilizing the link, but the interval can be
 tunable, and we can see what a good value is in the wild (the reverse case
 where we overutilize the link because we don't respond to cwnd getting cut
 due to a insufficiently frequent polling interval is no worse than the
 current behavior so I'm not worried about that).

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12890#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list