Tomas Krizek [Tue, 31 Mar 2020 15:32:09 +0000 (17:32 +0200)]
daemon: decrease tcp backlog to 128
From our TCP benchmarks, values over 128 don't seem to have any
measurable benefits, even with hundreds of thousands of connections.
On the contrary, during very high TCP and CPU load, smaller backlog
seems to dramatically improve latency for clients that keep idle TCP
connections.
During normal/low load, smaller backlog doesn't seem to have any
benefits.
When measured against "aggressive" clients that immediately close the
TCP connection once their query is answered, backlog smaller than 128
was measured to hurt performance.
The application's backlog size is ultimately limited by
net.core.somaxconn, which has been set to 128 prior to Linux 5.4.
Therefore, this change only affects newer kernels and those who have
manually set this value to a higher size.
For more, see
https://gitlab.labs.nic.cz/knot/knot-resolver/-/merge_requests/968
Petr Špaček [Tue, 31 Mar 2020 09:43:00 +0000 (11:43 +0200)]
deckard: abort if sendmmsg/recvmmsg are in use
Deckard does not support these and it leads to confusing errors.
In long term we need to migrate Deckard to different network backend:
https://gitlab.labs.nic.cz/knot/deckard/issues/42
Petr Špaček [Fri, 13 Mar 2020 17:23:33 +0000 (18:23 +0100)]
policy.DEBUG: log also final answer
Attempt to avoid duplicating ten lines in debug_logfinish_cb lead me
to splitting kr_log_qverbose_impl into two functions kr_log_q and kr_log_req.
This is another minor change to API exposed to modules.
Vladimír Čunát [Fri, 20 Mar 2020 16:28:54 +0000 (17:28 +0100)]
lib/generic/array: fix a strict aliasing problem
The issue here is that `char *` is not allowed to alias
with `anyType *`. With gcc-10 in Fedora this now started
to cause real problems and loading stats module segfaulted.
Actually I can't see in standard (C11 6.5 par.7) that using `void *`
is guaranteed to be correct, but at least it seems fine with gcc,
and e.g. some standard functions like posix_memalign() use it
in the same "dangerous" way.
Vladimír Čunát [Mon, 24 Feb 2020 17:32:26 +0000 (18:32 +0100)]
gc: don't re-open cache so often
Re-opening the cache causes fsync - every interval (1s by default).
Normally that isn't noticeable, but on encrypted ZFS it causes
high CPU consumption (even when "idle").
grahamc first reported this and Mic92 tested the patch helps. Thanks!
https://gitter.im/CZ-NIC/knot-resolver?at=5e4ea2343ca8a67fb808e349
Petr Špaček [Mon, 17 Feb 2020 08:56:48 +0000 (09:56 +0100)]
autogenerate AUTHORS file to get rid of outdated data
The file can be re-generated using scripts/update-authors.sh.
File .mailmap is used for name canonicalization and fresh list of
authors replaces the old one in AUTHORS file automatically.
Gitlab CI checks its content before release (on branches named release-*).
Marek Vavruša is listed in .mailmap file twice intentionally,
once as CZ.NIC employee and second time as external contributor.
Petr Špaček [Fri, 21 Feb 2020 15:27:41 +0000 (16:27 +0100)]
http: document source of bootstrap/bootswatch theme
Source is
git+https://github.com/twbs/bootstrap.git@a78dc3aed640a35914361b837ce24573a0515e19#yeti/bootstrap.min.css
but our version has minor modifications:
- removed link to font file
- minor font and line height adjustments
- added SPDX header
Diffing minimized CSS file is a mess so use something like
$ awk '{gsub(/{|}|;/,"&\n"); print}'
to get something more legible.
Petr Špaček [Thu, 20 Feb 2020 13:51:04 +0000 (14:51 +0100)]
http: update selectize.js to match upstream version 0.12.6
Originally we used version 0.12.0 but the files in our repo did not
exactly match files in the upstream repo and I could not confirm
if the changes were meaningful or just artifact of source minimization
process.
To remove uncertainity I've updated selectize.js to latest upstream version
0.12.6, did not do any extra CSS minimization, and removed unused file
selectize.min.css.
Petr Špaček [Tue, 18 Feb 2020 15:43:02 +0000 (16:43 +0100)]
mark bundled content with SPDX file
The SPDX file contains hand-written metadata about source URL, version,
authors, and license.
There are two missing pieces in HTTP module:
- bootswatch theme - I could not find what theme we ship, maybe it is
based on one of bootswatch themes but heavily modified
- selectize.js source does not match respective files in upstream but
contains minor changes
Vladimír Čunát [Tue, 18 Feb 2020 19:03:14 +0000 (20:03 +0100)]
meson: actually #define HAVE_ASPRINTF
I believe this should now correctly enable the code iff it's needed.
This commits and the parent will probably be no-op in practice.
I believe distros commonly do use fortification by default,
and I'm not aware of any platform with kresd and without asprintf().
I considered using `conf_data.set()` in meson, but that would require
us modifying contrib/ccan/asprintf/asprintf.h to include kresconfig.h,
and that seemed weird.