]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
overload mode: too many queries situation is detected and queries are dropped.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 23 Oct 2007 14:44:51 +0000 (14:44 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 23 Oct 2007 14:44:51 +0000 (14:44 +0000)
git-svn-id: file:///svn/unbound/trunk@717 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
doc/Changelog
doc/unbound.conf.5

index 1f0ebbba2eeaa205dda9b10908ba2e89aa3e720f..80a92f92778e703fd008d79301993abb0595dae5 100644 (file)
@@ -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;
 }
index e2aae25458023fe18bab1eac40178a8e52efdd1d..27aac958752cc6bcc8cb458411ede79373a422bf 100644 (file)
@@ -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
index 76182a71a8e7b26ffb8c813e5ca71b8a33fe04a8..17d69b802a0325c5ade37a4b040be05358654502 100644 (file)
@@ -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 <number>
 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>
 Number of bytes size of the RRset cache. Default is 4 megabytes.
 .It \fBrrset-cache-slabs:\fR <number>