Update README for the recursor separate package
Make trailing garbage no longer be fatal
Make separate recursor do skip-locking by default
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@637
d19b8d6e-7fed-0310-83ef-
9ca221ded41b
# for socket location, see config.h
OPTFLAGS?=-O3
-CXXFLAGS:= $(CXXFLAGS) -Wall $(OPTFLAGS)
-
+CXXFLAGS:= $(CXXFLAGS) -Wall $(OPTFLAGS) $(PROFILEFLAGS)
+LDFLAGS+= $(PROFILEFLAGS)
all: pdns_recursor rec_control
install: all
REC_CONTROL_OBJECTS=rec_channel.o rec_control.o arguments.o
pdns_recursor: $(PDNS_RECURSOR_OBJECTS)
- g++ $(PDNS_RECURSOR_OBJECTS) -o $@
+ g++ $(PDNS_RECURSOR_OBJECTS) $(LDFLAGS) -o $@
rec_control: $(REC_CONTROL_OBJECTS)
- g++ $(REC_CONTROL_OBJECTS) -o $@
+ g++ $(REC_CONTROL_OBJECTS) $(LDFLAGS) -o $@
$ CXXFLAGS=-I./boost-1.33.1/ make
4) Run ./pdns_recursor and you should be set!
-
\ No newline at end of file
+
+
+PERFORMANCE
+-----------
+
+For the utmost in performance, compile like this:
+
+ $ PROFILEFLAGS=-fprofile-generate make
+
+Then run the program for a bit, in as much of a real-life setting as you
+have available. Then run:
+
+ $ rec_control quit
+ bye
+
+Then do:
+
+ $ PROFILEFLAGS=-fprofile-use make clean all
+
+The resulting binary is up to 20% faster in our tests.
+
+PROBLEMS
+--------
+If you have problems linking, try removing the GCC_SKIP_LOCKING line from
+config.h
#define LOCALSTATEDIR "/var/run/"
#define VERSION "2.9.21"
#define RECURSOR
+#define GCC_SKIP_LOCKING
dr.d_content=boost::shared_ptr<DNSRecordContent>(DNSRecordContent::mastermake(dr, pr));
d_answers.push_back(make_pair(dr, pr.d_pos));
}
-
+
+#if 0
if(pr.d_pos!=contentlen) {
throw MOADNSException("Packet ("+d_qname+"|#"+lexical_cast<string>(d_qtype)+") has trailing garbage ("+ lexical_cast<string>(pr.d_pos) + " < " +
lexical_cast<string>(contentlen) + ")");
}
+#endif
}
catch(out_of_range &re) {
throw MOADNSException("Packet parsing error, out of bounds: "+string(re.what()));
int res=sr.beginResolve(dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), ret);
if(res<0) {
pw.getHeader()->rcode=RCode::ServFail;
+ pw.commit();
g_stats.servFails++;
}
else {
L<<Logger::Warning<<"Ignoring question on outgoing socket from "<<dc.getRemote()<<endl;
}
catch(MOADNSException& mde) {
- L<<Logger::Error<<"Unparseable packet from remote server "<< sockAddrToString((struct sockaddr_in*) &fromaddr, addrlen) <<": "<<mde.what()<<endl;
+ L<<Logger::Error<<"Unable to parse packet from remote UDP server "<< sockAddrToString((struct sockaddr_in*) &fromaddr, addrlen) <<": "<<mde.what()<<endl;
}
}
}
}
}
catch(MOADNSException& mde) {
- L<<Logger::Error<<"Unparseable packet from remote client "<< sockAddrToString((struct sockaddr_in*) &fromaddr, addrlen) <<": "<<mde.what()<<endl;
+ L<<Logger::Error<<"Unable to parse packet from remote udp client "<< sockAddrToString((struct sockaddr_in*) &fromaddr, addrlen) <<": "<<mde.what()<<endl;
}
}
}
dc=new DNSComboWriter(i->data, i->qlen, now);
}
catch(MOADNSException &mde) {
- L<<Logger::Error<<"Unparseable packet from remote TCP client "<<sockAddrToString(&i->remote,sizeof(i->remote))<<endl;
+ L<<Logger::Error<<"Unable to parse packet from remote TCP client "<<sockAddrToString(&i->remote,sizeof(i->remote))<<endl;
close(i->fd);
tcpconnections.erase(i);
break;