- Aug 11, 2022
-
-
Vladimír Čunát authored
This caused a huge increase in real memory usage in case of queries arriving to kresd while being disconnected from internet. The usage was slowly creeping up, even over 2G. Interesting past commits: b350d38d and two preceding. There apparently was no real memory leak. I assume that reusal of long-living mempools is risky in terms of memory fragmentation, though the extent of the issue surprised me very much. The issue seemed the same with normal glibc and jemalloc. I generally dislike ad-hoc optimization attempts like these freelists. Now the allocator can better decide *itself* how to reuse memory.
-
- May 02, 2022
-
-
- Feb 22, 2022
-
-
- Dec 22, 2021
-
-
Vladimír Čunát authored
The approach of the code was rather hacky, simulating some packets arriving from upstream and making the module stack CONSUME that. Instead we take a direct approach now: use the simplified validator API and then insert into cache directly. One effect is improved performance, and consequently roughly halving the lag which happens when prefill module invokes this. (With root zone the lag goes down to 0.1 s from over 0.2 s, on my relatively fast CPU. Fortunately it's just once a day.)
-
- May 24, 2021
-
-
Tomas Krizek authored
-
Tomas Krizek authored
-
- Apr 19, 2021
-
-
Vladimír Čunát authored
I see no potential use for `set`; it's not a suitable abstraction. And for `get` we want to use a pointer to the public type instead of the private one. Overall, worker.h has way too many stuff, but this branch is not a good place to clean it up.
-
- Dec 31, 2020
- Nov 10, 2020
-
-
Vladimír Čunát authored
Logging strings: I originally wanted to have four chars inside [], but it doesn't really matter in these cases where logs don't happen within a request, so "[xdp]" won due to uniformity and simplicity.
-
- Oct 27, 2020
-
-
Petr Špaček authored
It now contains either content of SYSTEMD_INSTANCE environment variable or stringified version of getpid() value. Main motivation is that the old worker.id was broken on systemd, i.e. the default installation. Related: #631
-
- Oct 13, 2020
-
-
Tomas Krizek authored
-
- Sep 23, 2020
-
-
Tomas Krizek authored
The variable name query is misleading, since the passed in packet can actually be a response as well (or a malformed packet).
-
- Feb 25, 2020
-
-
Long GNU GPLv3 boilderplate was automatically replaced with machine readable tag.
-
- Oct 10, 2019
-
-
Calling this on every incoming UDP request could cost us up to 5% time.
-
- Jul 16, 2019
-
-
Vladimír Čunát authored
-
- Jun 13, 2019
-
-
Vladimír Čunát authored
-
Vladimír Čunát authored
-
Vladimír Čunát authored
On many places we've been assuming that there's only a single worker, but we still often didn't utilize the property well. To get the pointer we used various ways, all even untyped: - __worker global variable in lua - uv_default_loop()->data - kr_request::daemon_context Now we instead simply define a global typed pointer the_worker. Nitpick: also worker_{init,deinit}() are reordered to correspond to the order of the fields, etc.
-
- Apr 29, 2019
-
-
Vladimír Čunát authored
- generate most of it from source - make order the same in implementation and description
-
- Dec 11, 2018
-
-
... upstreams list when closing outgoing connection
-
- Oct 12, 2018
-
-
Unificate handling of TCP timeouts for input and output connections; avoid redundant code; bugfixing
-
-
-
Vladimír Čunát authored
Also don't allocate much memory for cookies if we compile them out.
-
Vladimír Čunát authored
The support hasn't landed in libuv over all the years, and we've been still reserving memory for it in advance. Also comment on the singleton buffer usage.
-
Vladimír Čunát authored
I did NOT remove this one, as in a quick profile that would be increase in roughly 0.5% time in malloc, so that's possibly justifiable. (And this one is much less obstructing to splitting the worker code.)
-
Vladimír Čunát authored
See the message in parent commit.
-
Vladimír Čunát authored
A quick profiling showed no change in performance, and in particular no change in time spent in malloc/free. Some of the types in the union differed in size by a multiple. If their performance won't be satisfying, replacements should be considered first (e.g. jemalloc) before rolling our own stuff.
-
-
-
daemon: logic around struct session was relocated to separate module; input data buffering scheme was changed (libuv); attempt was made to simplify processing of the stream
-
- Sep 14, 2018
-
-
The error handling loop for uncorking TLS data was wrong, as the underlying push function is asynchronous and there's no relationship between completed DNS packet writes and number of TLS message writes. In case of the asynchronous function, the buffered data must be valid until the write is complete, currently this is not guaranteed and loading the resolver with pipelined requests results in memory errors: ``` $ getdns_query @127.0.0.1#853 -s -a -s -l L -B -F queries -q ... ==47111==ERROR: AddressSanitizer: heap-use-after-free on address 0x6290040a1253 at pc 0x00010da960d3 bp 0x7ffee2628b30 sp 0x7ffee26282e0 READ of size 499 at 0x6290040a1253 thread T0 #0 0x10da960d2 in wrap_write (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f0d2) #1 0x10d855971 in uv__write (libuv.1.dylib:x86_64+0xf971) #2 0x10d85422e in uv__stream_io (libuv.1.dylib:x86_64+0xe22e) #3 0x10d85b35a in uv__io_poll (libuv.1.dylib:x86_64+0x1535a) #4 0x10d84c644 in uv_run (libuv.1.dylib:x86_64+0x6644) #5 0x10d602ddf in main main.c:422 #6 0x7fff6a28a014 in start (libdyld.dylib:x86_64+0x1014) 0x6290040a1253 is located 83 bytes inside of 16895-byte region [0x6290040a1200,0x6290040a53ff) freed by thread T0 here: #0 0x10dacdfdd in wrap_free (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x56fdd) #1 0x10d913c2e in _mbuffer_head_remove_bytes (libgnutls.30.dylib:x86_64+0xbc2e) #2 0x10d915080 in _gnutls_io_write_flush (libgnutls.30.dylib:x86_64+0xd080) #3 0x10d90ca18 in _gnutls_send_tlen_int (libgnutls.30.dylib:x86_64+0x4a18) #4 0x10d90edde in gnutls_record_send2 (libgnutls.30.dylib:x86_64+0x6dde) #5 0x10d90f085 in gnutls_record_uncork (libgnutls.30.dylib:x86_64+0x7085) #6 0x10d5f6569 in tls_push tls.c:238 #7 0x10d5e5b2a in qr_task_send worker.c:1002 #8 0x10d5e2ea6 in qr_task_finalize worker.c:1562 #9 0x10d5dab99 in qr_task_step worker.c #10 0x10d5e12fe in worker_process_tcp worker.c:2410 ``` The current implementation adds opportunistic uv_try_write which either writes the requested data, or returns UV_EAGAIN or an error, which then falls back to slower asynchronous write that copies the buffered data. The function signature is changed from simple write to vectorized write. This also enables TLS False Start to save 1RTT when possible.
-
- May 30, 2018
-
-
Marek Vavruša authored
The handlers in Lua can now store per-request variables that are automatically GC'd when the request is finished. This is useful for stateful modules, such as DNS64 that uses internal option flags for state tracking. The layers can now get a variable table like so: ``` local vars = kres.request_t(r):vars() vars.hello = true ``` The variables are persisted between different layers for each request.
-
- Apr 19, 2018
-
-
- Apr 18, 2018
-
-
- Apr 13, 2018
-
-
Vladimír Čunát authored
-
- Feb 08, 2018
-
-
Grigorii Demidov authored
-
Grigorii Demidov authored
-