Commit 8ad90092 authored by Marek Vavruša's avatar Marek Vavruša

lib: turned some knobs

parent 884a5ac9
......@@ -140,15 +140,15 @@ static void qr_task_free(uv_handle_t *handle)
array_push(worker->pools, mp_context);
} else {
mp_delete(mp_context);
}
#if defined(__GLIBC__) && defined(_GNU_SOURCE)
/* Decommit memory every once in a while */
static size_t mp_delete_count = 0;
if (++mp_delete_count == 100 * MP_FREELIST_SIZE) {
malloc_trim(0);
mp_delete_count = 0;
}
#endif
/* Decommit memory every once in a while */
static size_t mp_delete_count = 0;
if (++mp_delete_count == 100 * MP_FREELIST_SIZE) {
malloc_trim(0);
mp_delete_count = 0;
}
#endif
}
static void qr_task_timeout(uv_timer_t *req)
......
......@@ -123,8 +123,8 @@ static int eval_nsrep(const char *k, void *v, void *baton)
update_nsrep(ns, (const knot_dname_t *)k, addr, score);
ns->reputation = reputation;
} else {
/* With 10% chance, probe server with a probability given by its RTT / MAX_RTT */
if ((kr_rand_uint(100) < 10) && (kr_rand_uint(KR_NS_MAX_SCORE) >= score)) {
/* With 5% chance, probe server with a probability given by its RTT / MAX_RTT */
if ((kr_rand_uint(100) < 5) && (kr_rand_uint(KR_NS_MAX_SCORE) >= score)) {
/* If this is a low-reliability probe, go with TCP to get ICMP reachability check. */
if (score >= KR_NS_LONG) {
qry->flags |= QUERY_TCP;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment