From: bert hubert Date: Thu, 5 Mar 2015 13:12:01 +0000 (+0100) Subject: reduce memory usage, but DNSName needs to go on a diet: 80 bytes sizeof!! X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~88^2~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bf269756111a2e07eefebee785c040befa73487;p=thirdparty%2Fpdns.git reduce memory usage, but DNSName needs to go on a diet: 80 bytes sizeof!! --- diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 9e2610381b..bbce2725ae 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -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(), "Execute this command on a running dnsdist") ("daemon", po::value()->default_value(true), "run in background") ("local", po::value >(), "Listen on which addresses") - ("max-outstanding", po::value()->default_value(65535), "maximum outstanding queries per downstream") + ("max-outstanding", po::value()->default_value(1024), "maximum outstanding queries per downstream") ("regex-drop", po::value(), "If set, block queries matching this regex. Mind trailing dot!") ("verbose,v", "be verbose"); diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index cd09f42e61..c240226989 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -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 age; + int origFD; // set to <0 to indicate this state is empty // 4 + + ComboAddress origRemote; // 28 + StopWatch sentTime; // 16 + DNSName qname; // 80 + std::atomic age; // 4 + uint16_t qtype; // 2 + uint16_t origID; // 2 }; struct Rings {