From: Wouter Wijngaards Date: Mon, 12 Jul 2010 13:59:39 +0000 (+0000) Subject: - Changed the defaults for num-queries-per-thread/outgoing-range. X-Git-Tag: release-1.4.6rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67c16277ee72221d6f42227f6995e8ddf3567bc3;p=thirdparty%2Funbound.git - Changed the defaults for num-queries-per-thread/outgoing-range. For builtin-select: 512/960, for libevent 1024/4096 and for windows 24/48 (because of win api). This makes the ratio this way to improve resilience under heavy load. For high performance, use libevent and possibly higher numbers. git-svn-id: file:///svn/unbound/trunk@2191 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 3056fc841..6cd29fd15 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,10 @@ +12 July 2010: Wouter + - Changed the defaults for num-queries-per-thread/outgoing-range. + For builtin-select: 512/960, for libevent 1024/4096 and for + windows 24/48 (because of win api). This makes the ratio this way + to improve resilience under heavy load. For high performance, use + libevent and possibly higher numbers. + 10 July 2010: Wouter - GOST enabled if SSL is recent and ldns has GOST enabled too. - ldns tarball updated. diff --git a/doc/example.conf.in b/doc/example.conf.in index 4a0652278..ae5556e78 100644 --- a/doc/example.conf.in +++ b/doc/example.conf.in @@ -54,8 +54,9 @@ server: # outgoing-interface: 2001:DB8::6 # number of ports to allocate per thread, determines the size of the - # port range that can be open simultaneously. - # outgoing-range: 256 + # port range that can be open simultaneously. About double the + # num-queries-per-thread, or, use as many as the OS will allow you. + # outgoing-range: 4096 # permit unbound to use this port number or port range for # making outgoing queries, using an outgoing interface. diff --git a/doc/unbound.conf.5.in b/doc/unbound.conf.5.in index 614bd4f19..f75ebc97e 100644 --- a/doc/unbound.conf.5.in +++ b/doc/unbound.conf.5.in @@ -141,8 +141,9 @@ sent via a random outgoing interface to counter spoofing. .TP .B outgoing\-range: \fI Number of ports to open. This number of file descriptors can be opened per -thread. Must be at least 1. Default is 256. Larger numbers need extra -resources from the operating system. +thread. Must be at least 1. Default depends on compile options. Larger +numbers need extra resources from the operating system. For performance a +a very large value is best, use libevent to make this possible. .TP .B outgoing\-port\-permit: \fI Permit unbound to open this port or range of ports for use to send queries. @@ -205,7 +206,7 @@ The number of queries that every thread will service simultaneously. If more queries arrive that need servicing, and no queries can be jostled out (see \fIjostle\-timeout\fR), then the queries are dropped. This forces the client to resend after a timeout; allowing the server time to work on -the existing queries. Default 1024. +the existing queries. Default depends on compile options, 512 or 1024. .TP .B jostle\-timeout: \fI Timeout used when the server is very busy. Set to a value that usually @@ -972,7 +973,7 @@ server: num\-threads: 1 outgoing\-num\-tcp: 1 # this limits TCP service, uses less buffers. incoming\-num\-tcp: 1 - outgoing\-range: 16 # uses less memory, but less performance. + outgoing\-range: 60 # uses less memory, but less performance. msg\-buffer\-size: 8192 # note this limits service, 'no huge stuff'. msg\-cache\-size: 100k msg\-cache\-slabs: 1 diff --git a/util/config_file.c b/util/config_file.c index a406ac970..39c18379c 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -90,11 +90,20 @@ config_create(void) cfg->use_syslog = 1; cfg->log_time_ascii = 0; #ifndef USE_WINSOCK - cfg->outgoing_num_ports = 256; +# ifdef USE_MINI_EVENT + /* select max 1024 sockets */ + cfg->outgoing_num_ports = 960; + cfg->num_queries_per_thread = 512; +# else + /* libevent can use many sockets */ + cfg->outgoing_num_ports = 4096; + cfg->num_queries_per_thread = 1024; +# endif cfg->outgoing_num_tcp = 10; cfg->incoming_num_tcp = 10; #else cfg->outgoing_num_ports = 48; /* windows is limited in num fds */ + cfg->num_queries_per_thread = 24; cfg->outgoing_num_tcp = 2; /* leaves 64-52=12 for: 4if,1stop,thread4 */ cfg->incoming_num_tcp = 2; #endif @@ -102,7 +111,6 @@ config_create(void) cfg->msg_buffer_size = 65552; /* 64 k + a small margin */ cfg->msg_cache_size = 4 * 1024 * 1024; cfg->msg_cache_slabs = 4; - cfg->num_queries_per_thread = 1024; cfg->jostle_time = 200; cfg->rrset_cache_size = 4 * 1024 * 1024; cfg->rrset_cache_slabs = 4;