From: Wouter Wijngaards Date: Tue, 23 Oct 2007 14:44:51 +0000 (+0000) Subject: overload mode: too many queries situation is detected and queries are dropped. X-Git-Tag: release-0.6~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=298e1fd6884bebd7c48b4ae8e427fae1c67997ac;p=thirdparty%2Funbound.git overload mode: too many queries situation is detected and queries are dropped. git-svn-id: file:///svn/unbound/trunk@717 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/worker.c b/daemon/worker.c index 1f0ebbba2..80a92f927 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -765,30 +765,16 @@ worker_handle_request(struct comm_point* c, void* arg, int error, server_stats_querymiss(&worker->stats, worker); /* grab a work request structure for this new request */ - /* @@@ TODO implement overload mode */ - if(0 && worker->env.mesh->all.count > worker->request_size) { - /* we could get this due to a slow tcp incoming query, - that started before we performed listen_pushback */ - verbose(VERB_DETAIL, "worker: too many incoming requests " - "active. dropping incoming query."); - verbose(VERB_ALGO, "currently servicing %d of %d queries", - (int)worker->env.mesh->all.count, - (int)worker->request_size); + if(worker->env.mesh->all.count > worker->request_size) { + verbose(VERB_ALGO, "Too many requests active. " + "dropping incoming query."); worker->stats.num_query_list_exceeded++; comm_point_drop_reply(repinfo); - query_info_clear(&qinfo); return 0; } mesh_new_client(worker->env.mesh, &qinfo, ldns_buffer_read_u16_at(c->buffer, 2), &edns, repinfo, *(uint16_t*)ldns_buffer_begin(c->buffer)); - - if(0) { /* TODO overload mode does not work yet. */ - if(worker->env.mesh->all.count == worker->request_size) { - /* the max request number has been reached, stop accepting */ - listen_pushback(worker->front); - } - } worker_mem_report(worker, NULL); return 0; } diff --git a/doc/Changelog b/doc/Changelog index e2aae2545..27aac9587 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -8,6 +8,7 @@ server is used; the fastest dnssec lame server is chosen. - added test then when trust anchor cannot be primed (nodata), the insecure mode from unbound works. + - Fixup max queries per thread, any more are dropped. 22 October 2007: Wouter - added donotquerylocalhost config option. Can be turned off for diff --git a/doc/unbound.conf.5 b/doc/unbound.conf.5 index 76182a71a..17d69b802 100644 --- a/doc/unbound.conf.5 +++ b/doc/unbound.conf.5 @@ -117,6 +117,9 @@ Must be set to a power of 2. Setting (close) to the number of cpus is a reasonable guess. .It \fBnum-queries-per-thread:\fR The number of queries that every thread will service simultaneously. +If more queries arrive that need servicing, they are dropped. This forces +the client to resend after a timeout; allowing the server time to work on +the existing queries. Default 1024. .It \fBrrset-cache-size:\fR Number of bytes size of the RRset cache. Default is 4 megabytes. .It \fBrrset-cache-slabs:\fR