Skip to content

[Analysis] Identify performance bottlenecks in native OpenClaw setup on constrained VPS #53600

Description

@SmithU64

Context

Running OpenClaw 2026.3.13 natively (no Docker) on a Hetzner CPX32 VPS:

  • CPU: 4× AMD EPYC Genoa vCPU
  • RAM: 8 GB
  • Disk: 160 GB SSD (56% used)
  • OS: Ubuntu, Linux 6.8.0-101-generic (x64)
  • Node.js: v22.22.0
  • Gateway: systemd-managed, loopback-only

Current config highlights

Setting Value
Primary model anthropic/claude-opus-4-6 (200k context)
contextTokens 800,000
compaction.keepRecentTokens 50,000
compaction.reserveTokensFloor 40,000
compaction.model claude-sonnet-4-6
contextPruning.mode cache-ttl (1h)
subagents.maxConcurrent 3
agents.defaults.maxConcurrent 4
memorySearch.enabled true (memory + sessions)
heartbeat every 30m, haiku model
timeoutSeconds 240
Channel Telegram (streaming off, queue mode)

Request

Perform a systematic analysis of potential performance bottlenecks that could cause reasoning slowness in this native setup. Specifically:

1. Context assembly & prompt size

  • With contextTokens: 800000 and models that have 200k native windows, how does OpenClaw handle the mismatch? Is there unnecessary token counting, truncation overhead, or wasted prompt assembly work?
  • How does workspace file injection (AGENTS.md, SOUL.md, USER.md, TOOLS.md, etc.) scale? Are these re-read and re-tokenized on every turn?

2. Memory search overhead

  • memorySearch with session recall enabled — does the embedding search (OpenAI text-embedding-3-small) happen synchronously before each model call?
  • What is the latency profile of memory search on a VPS with no GPU and external API calls?
  • Is there any caching of embedding results or does it re-embed the query every time?

3. Compaction pipeline

  • Compaction uses a separate model call (claude-sonnet-4-6). When does this fire vs. the actual reasoning call? Is it sequential or parallel?
  • On a 4-vCPU box, is the Node.js event loop blocked during compaction token counting?

4. Subagent orchestration

  • With maxConcurrent: 3 subagents + maxConcurrent: 4 agents, what is the actual concurrency behavior?
  • Are subagent spawns serialized behind a single event loop? Do they share the same Node.js process or fork?
  • What is the overhead of the announce-back mechanism?

5. Telegram channel latency

  • streaming: off + blockStreaming: true means the full response must complete before delivery. For long reasoning chains this adds perceived latency.
  • queue mode — does message queueing add artificial delays between user messages and processing start?
  • timeoutSeconds: 90 on Telegram — does this cause premature aborts on complex multi-tool reasoning turns?

6. Hook overhead per turn

  • 4 internal hooks enabled (boot-md, bootstrap-extra-files, command-logger, session-memory). What is their per-turn cost?
  • Does session-memory hook do synchronous I/O on every turn?

7. Auth fallback chain

  • 2 Anthropic accounts, 2 OpenAI-Codex accounts with 2h billing backoff. Does the fallback probing add latency on every request, or only on failure?

8. Node.js / OS level

  • 4 vCPUs with LimitNOFILE=524288 — is there any event loop contention when running gateway + multiple subagent sessions?
  • Is there measurable GC pressure at 8 GB RAM with large context windows?

Expected outcome

A documented analysis (or instrumentation plan) that identifies:

  1. Measured or estimated latency contribution of each layer
  2. Quick wins — config changes that reduce latency without code changes
  3. Code-level improvements — where the gateway pipeline could be optimized
  4. Instrumentation gaps — what timing data is missing today to diagnose slowness

Environment

OpenClaw 2026.3.13 (61d171a)
Node.js v22.22.0
Linux 6.8.0-101-generic x64
AMD EPYC Genoa 4 vCPU / 8 GB RAM
Native systemd deployment (no Docker)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions