#define MP_FREELIST_SIZE 32 /**< Maximum length of the worker mempool freelist */
#endif
#ifndef RECVMMSG_BATCH
-#define RECVMMSG_BATCH 8
+#define RECVMMSG_BATCH 5
#endif
/*
static inline void ioreq_release(struct worker_ctx *worker, struct ioreq *req)
{
- if (!req || worker->ioreqs.len < MP_FREELIST_SIZE) {
+ if (!req || worker->ioreqs.len < 4 * MP_FREELIST_SIZE) {
array_push(worker->ioreqs, req);
} else {
free(req);
pool.ctx = array_tail(worker->pools);
array_pop(worker->pools);
} else { /* No mempool on the freelist, create new one */
- pool.ctx = mp_new (20 * CPU_PAGE_SIZE);
+ pool.ctx = mp_new (4 * CPU_PAGE_SIZE);
}
/* Create worker task */
answer_max = KNOT_WIRE_MAX_PKTSIZE;
} else if (knot_pkt_has_edns(query)) { /* EDNS */
answer_max = knot_edns_get_payload(query->opt_rr);
+ if (answer_max < KNOT_WIRE_MIN_PKTSIZE) {
+ answer_max = KNOT_WIRE_MIN_PKTSIZE;
+ }
}
/* How much space do we need for intermediate packets? */
size_t pktbuf_max = KNOT_EDNS_MAX_UDP_PAYLOAD;