Changeset 1505
- Timestamp:
- 02/01/10 22:54:44 (6 weeks ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 2 modified
-
pdns_recursor.cc (modified) (7 diffs)
-
syncres.hh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/pdns_recursor.cc
r1504 r1505 107 107 tcpListenSockets_t g_tcpListenSockets; // shared across threads, but this is fine, never written to from a thread. All threads listen on all sockets 108 108 int g_tcpTimeout; 109 unsigned int g_maxMThreads; 109 110 struct timeval g_now; // timestamp, updated (too) frequently 110 111 map<int, ComboAddress> g_listenSocketsAddresses; // is shared across all threads right now … … 750 751 int newsock=(int)accept(fd, (struct sockaddr*)&addr, &addrlen); 751 752 if(newsock>0) { 753 if(MT->numProcesses() > g_maxMThreads) { 754 g_stats.overCapacityDrops++; 755 Utility::closesocket(newsock); 756 return; 757 } 758 752 759 g_stats.addRemote(addr); 753 760 if(t_allowFrom && !t_allowFrom->match(&addr)) { … … 788 795 socklen_t addrlen=sizeof(fromaddr); 789 796 797 790 798 if((len=recvfrom(fd, data, sizeof(data), 0, (sockaddr *)&fromaddr, &addrlen)) >= 0) { 799 791 800 g_stats.addRemote(fromaddr); 792 801 … … 825 834 throw MOADNSException(e.what()); // translate 826 835 } 836 if(MT->numProcesses() > g_maxMThreads) { 837 g_stats.overCapacityDrops++; 838 return; 839 } 840 827 841 DNSComboWriter* dc = new DNSComboWriter(data, len, g_now); 828 842 dc->setSocket(fd); … … 1529 1543 L<<Logger::Warning<<"Operating in "<<(sizeof(unsigned long)*8) <<" bits mode"<<endl; 1530 1544 1545 #if 0 1546 unsigned int maxFDs, curFDs; 1547 getFDLimits(curFDs, maxFDs); 1548 if(curFDs < 2048) 1549 L<<Logger::Warning<<"Only "<<curFDs<<" file descriptors available (out of: "<<maxFDs<<"), may not be suitable for high performance"<<endl; 1550 #endif 1551 1531 1552 seedRandom(::arg()["entropy-source"]); 1532 1553 … … 1632 1653 g_tcpTimeout=::arg().asNum("client-tcp-timeout"); 1633 1654 g_maxTCPPerClient=::arg().asNum("max-tcp-per-client"); 1655 g_maxMThreads=::arg().asNum("max-mthreads"); 1634 1656 1635 1657 int numThreads = ::arg().asNum("threads"); … … 1855 1877 ::arg().set("query-local-address6","Source IPv6 address for sending queries")=""; 1856 1878 ::arg().set("client-tcp-timeout","Timeout in seconds when talking to TCP clients")="2"; 1879 ::arg().set("max-mthreads", "Maximum number of simultaneous Mtasker threads")="2048"; 1857 1880 ::arg().set("max-tcp-clients","Maximum number of simultaneous TCP clients")="128"; 1858 1881 ::arg().set("hint-file", "If set, load root hints from this file")=""; -
trunk/pdns/pdns/syncres.hh
r1496 r1505 472 472 uint64_t spoofCount; 473 473 uint64_t resourceLimits; 474 uint64_t overCapacityDrops; 474 475 uint64_t ipv6queries; 475 476 uint64_t chainResends;