-
Notifications
You must be signed in to change notification settings - Fork 3
[LOW][Performance] Startup Time - No Connection Pre-Warming #174
Copy link
Copy link
Open
Labels
category: code-qualityCode quality and maintainabilityCode quality and maintainabilityenhancementNew feature or requestNew feature or requestpfsense-mcpIssues specific to pfSense MCP serverIssues specific to pfSense MCP serverseverity: lowLow priority issueLow priority issuetruenas-mcpIssues specific to TrueNAS MCP serverIssues specific to TrueNAS MCP server
Description
Summary
Servers initialize components sequentially with no connection pre-warming. First request after startup is slow due to SSL handshake, DNS resolution, and initial authentication.
Affected Files
truenas-mcp/src/http_server.py:124-136(lifespan startup)pfsense-mcp/src/http_pfsense_server.py:124-138(initialization)
Impact
First request latency:
- DNS: 10-100ms
- TCP handshake: 10-50ms
- TLS handshake: 50-200ms
- Auth: 100-500ms
- Total: 170-850ms vs. subsequent requests at 10-50ms
Recommended Fix
Optional warmup during startup:
# In lifespan startup
if app_settings.warmup_connection:
try:
logger.info("Warming up connection...")
asyncio.create_task(server.client.connect())
except Exception as e:
logger.warning(f"Connection warmup failed: {e}")Trades startup time for improved first-request latency.
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
category: code-qualityCode quality and maintainabilityCode quality and maintainabilityenhancementNew feature or requestNew feature or requestpfsense-mcpIssues specific to pfSense MCP serverIssues specific to pfSense MCP serverseverity: lowLow priority issueLow priority issuetruenas-mcpIssues specific to TrueNAS MCP serverIssues specific to TrueNAS MCP server