From dcc99040d63669280eff63658c78891c9e9d9ce2 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 21 Jun 2026 19:35:04 +0200 Subject: [PATCH] nix(loadtest): run more requests in jwt-cache test We don't need to restrict us to run every request once. Instead we can run as many as possible within 60s by removing the `-lazy` flag. This also allows us to generate fewer targets, because vegeta will do the repetition for us. --- nix/tools/generate_targets.py | 7 ++----- nix/tools/loadtest.nix | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/nix/tools/generate_targets.py b/nix/tools/generate_targets.py index 82d273da5..cdd8e087e 100644 --- a/nix/tools/generate_targets.py +++ b/nix/tools/generate_targets.py @@ -77,8 +77,7 @@ def main(): jwks_path.write_text(jwks.export()) print(f"Created JWKSet on {jwks_path}") - nsamples = 500 # per algorithm - ntargets = 100000 + ntargets = 1000 print(f"Generating {ntargets} targets...") @@ -86,10 +85,8 @@ def main(): lines = [] - hs_targets = [generate_target(now, hs) for _ in range(nsamples)] - rsa_targets = [generate_target(now, rsa) for _ in range(nsamples)] for i in range(ntargets): - target = random.choice(hs_targets if i % 2 == 0 else rsa_targets) + target = generate_target(now, hs if i % 2 == 0 else rsa) lines.extend(target) with open(targets_path, "w") as f: diff --git a/nix/tools/loadtest.nix b/nix/tools/loadtest.nix index d2edf7063..9ea0d8a88 100644 --- a/nix/tools/loadtest.nix +++ b/nix/tools/loadtest.nix @@ -73,7 +73,7 @@ let ${withTools.withPg} -f "$_arg_testdir"/fixtures.sql \ ${withTools.withPgrst} --faketime '2000-01-01 00:00:00' -m "$_arg_monitor" \ sh -c "cd \"$_arg_testdir\" && \ - ${runner} -lazy -targets gen_targets.http -output \"$abs_output\" \"''${_arg_leftovers[@]}\"" + ${runner} -targets gen_targets.http -output \"$abs_output\" \"''${_arg_leftovers[@]}\"" ;; # here we sleep purposefully to check how much memory does the schema cache consume in the final report