]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
reduce memory usage, but DNSName needs to go on a diet: 80 bytes sizeof!!
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Mar 2015 13:12:01 +0000 (14:12 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 5 Mar 2015 13:12:01 +0000 (14:12 +0100)
pdns/dnsdist.cc
pdns/dnsdist.hh

index 9e2610381bde9d5a8a2e16c4195cf659b6fe6b1e..bbce2725aed7c884c82e463608d83e9a379641bf 100644 (file)
@@ -152,7 +152,6 @@ DownstreamState::DownstreamState(const ComboAddress& remote_)
   
   fd = SSocket(remote.sin4.sin_family, SOCK_DGRAM, 0);
   SConnect(fd, remote);
-  
   idStates.resize(g_maxOutstanding);
   sw.start();
   infolog("Added downstream server %s", remote.toStringWithPort());
@@ -931,7 +930,7 @@ try
     ("command,c", po::value<string>(), "Execute this command on a running dnsdist")
     ("daemon", po::value<bool>()->default_value(true), "run in background")
     ("local", po::value<vector<string> >(), "Listen on which addresses")
-    ("max-outstanding", po::value<uint16_t>()->default_value(65535), "maximum outstanding queries per downstream")
+    ("max-outstanding", po::value<uint16_t>()->default_value(1024), "maximum outstanding queries per downstream")
     ("regex-drop", po::value<string>(), "If set, block queries matching this regex. Mind trailing dot!")
     ("verbose,v", "be verbose");
     
index cd09f42e61333103f333ea69341f52c56a188d23..c240226989ef0b52042f5c1dbc38055473ac9714 100644 (file)
@@ -113,13 +113,14 @@ struct IDState
     age.store(orig.age.load());
   }
 
-  int origFD;  // set to <0 to indicate this state is empty
-  uint16_t origID;
-  ComboAddress origRemote;
-  StopWatch sentTime;
-  DNSName qname;
-  uint16_t qtype;
-  std::atomic<uint64_t> age;
+  int origFD;  // set to <0 to indicate this state is empty   // 4
+
+  ComboAddress origRemote;                                    // 28
+  StopWatch sentTime;                                         // 16
+  DNSName qname;                                              // 80
+  std::atomic<uint16_t> age;                                  // 4
+  uint16_t qtype;                                             // 2
+  uint16_t origID;                                            // 2
 };
 
 struct Rings {