1. 07 Sep, 2020 23 commits
  2. 10 Aug, 2020 2 commits
  3. 14 Mar, 2016 1 commit
  4. 07 Feb, 2016 1 commit
  5. 19 Sep, 2015 1 commit
  6. 02 Aug, 2015 1 commit
  7. 28 Jun, 2015 3 commits
  8. 26 Jun, 2015 1 commit
    • Ralph Bean's avatar
      Use tcp for SRV lookups. · 1a5692dc
      Ralph Bean authored
      By default, the DNS module is using udp.  I discovered this because it would
      periodically time out on our server -- requests would sometimes take 30s that
      would normally take less than 1s.  I'd like to use tcp for our use case in
      order to avoid timeouts. However, that alone is not reason enough to ask
      everyone else to use tcp.  They may want udp.  It is faster, right?
      
      While playing with this, I found that on average tcp is repeatably faster than
      udp for these kinds of requests.
      
      See tcp:
      
        $ time python -c """
        import DNS
        DNS.DiscoverNameServers()
        [DNS.Request(name='_avatars._tcp.ralph.id.fedoraproject.org', qtype='SRV', protocol='tcp').req() for i in range(128)]
        """
        python -c   0.10s user 0.03s system 10% cpu 1.270 total
      
      Versus udp:
      
        $ time python -c """
        import DNS
        DNS.DiscoverNameServers()
        [DNS.Request(name='_avatars._tcp.ralph.id.fedoraproject.org', qtype='SRV', protocol='udp').req() for i in range(128)]
        """
        python -c   0.24s user 0.11s system 3% cpu 9.514 total
      
      
      Which makes it a more suitable default for libravatar.py, no?
      1a5692dc
  9. 01 Sep, 2014 2 commits
  10. 24 Sep, 2013 3 commits
  11. 05 Dec, 2011 1 commit
  12. 17 Nov, 2011 1 commit