ARCH: Multi-user bridge needs ThreadingHTTPServer (concurrency fix) #1356

Closed
opened 2026-04-13 06:29:30 +00:00 by Timmy · 3 comments
Owner

Finding

Experiment 4 (concurrent load test) revealed that Python's single-threaded http.server.HTTPServer cannot handle multiple simultaneous users. With 10 concurrent requests, 60% timed out at 30s.

Root Cause

HTTPServer processes requests sequentially. Each LLM call blocks the server for 5-10 seconds, queuing all other users.

Fix

Replace with ThreadingHTTPServer (Python 3.7+):

from socketserver import ThreadingHTTPServer
server = ThreadingHTTPServer((BRIDGE_HOST, BRIDGE_PORT), BridgeHandler)

Impact

  • Before: 4/10 users complete (40%), 7.8s avg
  • After: expected 10/10 users complete (100%), ~5s avg

Evidence

See paper Results section: Experiment 4 load test results.
PR: the-nexus feat/paper-results

## Finding Experiment 4 (concurrent load test) revealed that Python's single-threaded `http.server.HTTPServer` cannot handle multiple simultaneous users. With 10 concurrent requests, 60% timed out at 30s. ## Root Cause `HTTPServer` processes requests sequentially. Each LLM call blocks the server for 5-10 seconds, queuing all other users. ## Fix Replace with `ThreadingHTTPServer` (Python 3.7+): ```python from socketserver import ThreadingHTTPServer server = ThreadingHTTPServer((BRIDGE_HOST, BRIDGE_PORT), BridgeHandler) ``` ## Impact - Before: 4/10 users complete (40%), 7.8s avg - After: expected 10/10 users complete (100%), ~5s avg ## Evidence See paper Results section: Experiment 4 load test results. PR: the-nexus feat/paper-results
ezra was assigned by Timmy 2026-04-13 06:30:21 +00:00
Owner

🔥 BURN DISPATCH — YOLOBURN pane %16

Timmy dispatched this issue to the BURN session for immediate work. Gitea-first workflow active.

🔥 **BURN DISPATCH** — YOLOBURN pane %16 Timmy dispatched this issue to the BURN session for immediate work. Gitea-first workflow active.
Owner

🌐 NEXUSBURN — pane 1 (Development)

🌐 **NEXUSBURN** — pane 1 (Development)
Owner

🔥 BURN — NEXUSBURN.1 claimed from [ezra]

🔥 **BURN** — NEXUSBURN.1 claimed from [ezra]
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#1356