From 2d58afefe6552bd19f2377c0fe8e28f51b803f36 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Jul 2026 05:13:56 +0000 Subject: [PATCH] feat(amy): AMY_RELAY_SUB_CAP env override for the per-relay sub cap Phase-B throughput plateaus at ~100-150 users/s at every crawl scale while CPU/FDs/network sit idle, pointing at the per-relay 16-permit gates on the hot backbone/fallback relays every batch touches. The 16-vs-100 benchmark that chose the default predates the multithreaded-crawl fix, so expose the starting cap for A/B runs; the NOTICE/CLOSED demotion ladder still protects relays that push back. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_013zEYRGKF943RgLaHTViJaB --- .../main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt index 1142529607..3bc81e4dcf 100644 --- a/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt +++ b/cli/src/main/kotlin/com/vitorpamplona/amethyst/cli/Context.kt @@ -220,7 +220,11 @@ class Context( // on a from-scratch GrapeRank crawl than the old 100 (which drowned // damus/nos.lol in 100 concurrent giant REQs) at equal completeness, and // is still generous for the single-user fetches other amy commands do. - startCap = 16, + // AMY_RELAY_SUB_CAP overrides for experiments — the crawl's Phase-B + // throughput plateaus on hot-relay permit queues, and the 16-vs-100 + // benchmark predates the multithreaded-crawl fix, so the sweet spot may + // sit higher; relays that complain still get demoted down the ladder. + startCap = System.getenv("AMY_RELAY_SUB_CAP")?.toIntOrNull()?.coerceIn(1, 100) ?: 16, ).also { client.addConnectionListener(it) } /**