Skip to content

Use per-loop memory contexts for dns_resolver child objects

Ondřej Surý requested to merge ondrej-use-loop-mctx-in-dns_resolver into main

The dns_resolver creates a lot of smaller objects (fetch context, fetch counter, query, response, ...) and those are all loop-bound. Previously, those objects were allocated from the a single resolver context, which in turn increases contention between threads - remember "dead by thousand atomic paper cuts". Instead of using a single memory context, use the per-loop memory contexts that are bound to a specific loop and thus there's no contention between them when doing the memory accounting.

Edited by Evan Hunt

Merge request reports