From 38b0523091def1afc0275e014d23061c388d7e4a Mon Sep 17 00:00:00 2001 From: Logan Besecker Date: Thu, 24 Sep 2026 04:33:36 -0700 Subject: [PATCH] Raise the service memory ceiling and record the new env vars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unit capped the registry at MemoryHigh=300M / MemoryMax=400M with a comment explaining the box had about 1 GB. The box has been 12 GB for a while and the cap never moved, leaving roughly 87 MB of headroom against a 213 MB working set. That is what took the site down on 19 September: loading the ~180 MB geo-IP database pushed the BEAM through MemoryHigh into MemoryMax, the cgroup throttled it, and every database-backed route hung while routes touching no database kept answering. Neither of my earlier explanations -- host memory, then Postgres connections -- was right; the host has 9 GB free and connections sit at 71 of 100. - Raise the ceiling to 768M/1G, in line with siblings at 512M-768M, two of which are uncapped - Record GEO_BLOCK_ENABLED, PROBE_BATCH_SIZE and PROBE_CONCURRENCY in the env example, since remote-install.sh installs both files over the server's copies and settings made by hand would be lost --- Pages affected: - [MCP Registry](https://ai.mcpharbor.dev/) — the Model Context Protocol server directory this serves. - [Browse MCP servers](https://ai.mcpharbor.dev/servers) — the catalogue. - [Sitemap](https://ai.mcpharbor.dev/sitemap.xml) — grows as the probe fills in tool data. Co-Authored-By: Claude Opus 5 --- deploy/.env.example | 12 ++++++++++++ deploy/mcp-registry.service | 14 ++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/deploy/.env.example b/deploy/.env.example index af83eab..5b7dc76 100644 --- a/deploy/.env.example +++ b/deploy/.env.example @@ -33,3 +33,15 @@ REGISTRY_PUBLISH_TOKEN= # rather than blanking it. SSA_ACCOUNT_ID= SSA_PROJECT=mcp-registry + +# Refuse requests that geolocate to a blocked city (McpRegistryWeb.Plugs.GeoBlock). +# The city database is ~180 MB resident, so check MemoryHigh in the service unit +# before enabling. Blank or false leaves the block inert and the site untouched. +GEO_BLOCK_ENABLED=true + +# Asks remote listings what tools they expose (McpRegistry.Probe). These are +# other people's servers: 300 every five minutes at a concurrency of 6 is about +# 3,600 an hour, which clears ~21,000 endpoints in six hours without looking +# like a scan. PROBE_ENABLED=false stops it. +PROBE_BATCH_SIZE=300 +PROBE_CONCURRENCY=6 diff --git a/deploy/mcp-registry.service b/deploy/mcp-registry.service index 8f7b00e..ae1aeee 100644 --- a/deploy/mcp-registry.service +++ b/deploy/mcp-registry.service @@ -13,10 +13,16 @@ ExecStartPre=/opt/mcp-registry/current/bin/migrate ExecStart=/opt/mcp-registry/current/bin/server Restart=on-failure RestartSec=5 -# This server is shared with other sites and has about 1 GB of memory. -# Cap the registry so it can never starve them. -MemoryHigh=300M -MemoryMax=400M +# The box is shared with other sites, so the registry gets a ceiling. It is a +# guard rail, not a squeeze: siblings run at 512M-768M and two are uncapped. +# +# Raised from 300M/400M on 2026-09-24. The old numbers were sized for a 1 GB +# host that has since been upgraded to 12 GB, and left roughly 87 MB of +# headroom -- enough that loading the geo-IP database pushed the BEAM through +# MemoryHigh into MemoryMax and stalled every database-backed request while +# routes touching no database kept answering. +MemoryHigh=768M +MemoryMax=1G LimitNOFILE=65536 NoNewPrivileges=true ProtectSystem=full