mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
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
This commit is contained in:
parent
861483ac82
commit
298e1fd688
3 changed files with 7 additions and 17 deletions
|
|
@ -765,30 +765,16 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
|
||||||
server_stats_querymiss(&worker->stats, worker);
|
server_stats_querymiss(&worker->stats, worker);
|
||||||
|
|
||||||
/* grab a work request structure for this new request */
|
/* grab a work request structure for this new request */
|
||||||
/* @@@ TODO implement overload mode */
|
if(worker->env.mesh->all.count > worker->request_size) {
|
||||||
if(0 && worker->env.mesh->all.count > worker->request_size) {
|
verbose(VERB_ALGO, "Too many requests active. "
|
||||||
/* we could get this due to a slow tcp incoming query,
|
"dropping 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);
|
|
||||||
worker->stats.num_query_list_exceeded++;
|
worker->stats.num_query_list_exceeded++;
|
||||||
comm_point_drop_reply(repinfo);
|
comm_point_drop_reply(repinfo);
|
||||||
query_info_clear(&qinfo);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
mesh_new_client(worker->env.mesh, &qinfo,
|
mesh_new_client(worker->env.mesh, &qinfo,
|
||||||
ldns_buffer_read_u16_at(c->buffer, 2),
|
ldns_buffer_read_u16_at(c->buffer, 2),
|
||||||
&edns, repinfo, *(uint16_t*)ldns_buffer_begin(c->buffer));
|
&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);
|
worker_mem_report(worker, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
server is used; the fastest dnssec lame server is chosen.
|
server is used; the fastest dnssec lame server is chosen.
|
||||||
- added test then when trust anchor cannot be primed (nodata), the
|
- added test then when trust anchor cannot be primed (nodata), the
|
||||||
insecure mode from unbound works.
|
insecure mode from unbound works.
|
||||||
|
- Fixup max queries per thread, any more are dropped.
|
||||||
|
|
||||||
22 October 2007: Wouter
|
22 October 2007: Wouter
|
||||||
- added donotquerylocalhost config option. Can be turned off for
|
- added donotquerylocalhost config option. Can be turned off for
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,9 @@ Must be set to a power of 2. Setting (close) to the number of cpus is a
|
||||||
reasonable guess.
|
reasonable guess.
|
||||||
.It \fBnum-queries-per-thread:\fR <number>
|
.It \fBnum-queries-per-thread:\fR <number>
|
||||||
The number of queries that every thread will service simultaneously.
|
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>
|
.It \fBrrset-cache-size:\fR <number>
|
||||||
Number of bytes size of the RRset cache. Default is 4 megabytes.
|
Number of bytes size of the RRset cache. Default is 4 megabytes.
|
||||||
.It \fBrrset-cache-slabs:\fR <number>
|
.It \fBrrset-cache-slabs:\fR <number>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue