memorix icon indicating copy to clipboard operation
memorix copied to clipboard

HTTP control plane wedges /health on 40k+ observation stores

Open RaviTharuma opened this issue 3 months ago • 3 comments

Description

On hosts with a large local store (~40k–64k observations and a ~305MB Jina embedding cache), memorix serve-http accepts TCP on :3211 but /health and MCP initialize time out for tens of seconds. LaunchAgents / watchdogs that probe /health or initialize in 15s then kill a process that is still warming up, which looks like a crash loop.

This is the HTTP control-plane form of #27 (closed). 1.6.0 still hydrates the corpus and parses the on-disk embedding cache on the HTTP event loop during createMemorixServer / first runtime init. stdio already had deferProjectRuntimeInit: true; serve-http did not (until the work in #214).

Steps to Reproduce

  1. Use a live store with ~40k+ SQLite observations and a ~300MB .embedding-api-cache.json / .jsonl.
  2. memorix background start from a git project (not $HOME).
  3. Immediately curl -m 5 http://127.0.0.1:3211/health and POST MCP initialize with a 15s timeout.
  4. Optionally run a LaunchAgent that kills the listener when initialize exceeds 15s.

Expected Behavior

/health answers in milliseconds as soon as the HTTP server is listening. MCP initialize / tools/list complete without waiting for corpus hydrate or cache parse. Vector attach happens after the handshake.

Actual Behavior

/health times out. initialize returns 0 bytes for 15–20s. Watchdogs SIGTERM a healthy warmup. OpenCode / Grok / Cursor HTTP clients mark the server failed.

Environment

  • Memorix 1.6.0 (npm / bun global)
  • macOS 26.6 (darwin 25.6.0) and Linux (dev host)
  • ~44k–64k observations, Jina Omni 1024d, ~305MB embedding cache
  • HTTP control plane on 127.0.0.1:3211

Additional Context

Fix direction is in #214 (deferProjectRuntimeInit on serve-http). Owner asked that PR to rebase onto current main (1.6.1) and drop the stacked #212 rerank commit.

Related: #27, #70, #214.

RaviTharuma avatar Aug 17 '26 13:08 RaviTharuma

Field-report index from a 2026-08-17 three-host E2E (MacBook 16, MacBook 13, Linux). Each item is its own issue:

  • #215 HTTP /health wedge on 40k+ stores
  • #216 Embedding cache worker destroyed a 319MB on-disk cache
  • #217 Hook writes loadAll() the full corpus
  • #218 CLI memory search stays alive after printing
  • #219 background start can spawn dist/index.js (stdio)
  • #220 background start can launch $HOME/node_modules/memorix
  • #221 Cache-only provider create still parses JSONL
  • #222 Concurrent cache loads parse JSONL twice
  • #223 Vector attach starves MCP initialize / OpenCode
  • #224 First memorix_session_start still 15–28s
  • #225 $HOME bind + decoy ~/memorix.db (follow-up to #198)

Fix direction for 215–223 is in #214 (needs rebase onto current main / 1.6.1; must not carry #212). #224 and #225 remain after that PR.

RaviTharuma avatar Aug 17 '26 13:08 RaviTharuma

Fix is in PR https://github.com/AVIDS2/memorix/pull/214 — not on main yet, so leaving this issue open until that PR merges.

Relevant work:

  • 35358a1a4c — defer HTTP runtime hydration until the first real tool so /health stays responsive on 40k+ stores
  • Files: src/cli/commands/serve-http.ts, src/sdk.ts, src/memory/observations.ts
  • Follow-up: 01763fa1ee (initialize stays responsive while cached vectors attach), 382e367d9d (ordinary store off the embedding-cache hot path)

Out of scope for #214 (tracked separately): #224 first memorix_session_start 15–28s, #225 $HOME / decoy db.

RaviTharuma avatar Aug 17 '26 16:08 RaviTharuma

Fixed by #214 and released in v1.6.2. The control plane now starts serving /health before large-store hydration work, and the 40,000-record acceptance gate passes on Windows. Closing as shipped.

AVIDS2 avatar Aug 18 '26 10:08 AVIDS2