From d48997cfb443512cff63a3f9aff31a96ced3e961 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Wed, 13 Mar 2024 06:22:24 +0100 Subject: [PATCH] generate only one upstream per worker --- lib.nix | 1 + tests/nginx-pipeline/default.nix | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib.nix b/lib.nix index b9b04af..24a769d 100644 --- a/lib.nix +++ b/lib.nix @@ -29,6 +29,7 @@ rec { # Subindex by resource names, listener types, and convert to upstreams (lib.mapAttrs (_: workers: lib.pipe workers [ (lib.concatMap (worker: worker.settings.worker_listeners)) + lib.lists.head # only select one listener for the worker to avoid cache thrashing lib.flatten mapListenersToUpstreamsByType ])) diff --git a/tests/nginx-pipeline/default.nix b/tests/nginx-pipeline/default.nix index 87d84a8..03958cc 100644 --- a/tests/nginx-pipeline/default.nix +++ b/tests/nginx-pipeline/default.nix @@ -20,6 +20,20 @@ let normalSyncers = 1; eventPersisters = 1; useUserDirectoryWorker = true; + + instances.auto-fed-receiver1.settings.worker_listeners = [ + { + bind_addresses = [ + "127.0.0.2" + ]; + port = 1337; + resources = [ + { compress = false; + names = [ "federation" ]; + } + ]; + } + ]; }; settings.server_name = "example.com";